Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to load/use CSS file programetically through java - birt report engine
Pats
<p>Hi ,</p>
<p> </p>
<p>Am able to render report from java using report engine . but css not reflecting with the report .</p>
<p>How to load/use CSS file programetically through java .</p>
<p> </p>
<p>Thanks</p>
Find more posts tagged with
Comments
android272
<p>At the top of my class I instantiated a global variable called designHandle and set it equal to null.</p>
<pre class="_prettyXprint _lang-">
ReportDesignHandle designHandle = null;
</pre>
<p>Then I made a buildCSS() method that dose this.</p>
<pre class="_prettyXprint _lang-">
private void bildCSS() throws SemanticException, StyleSheetException {
try {
ReportDesignHandle report = (ReportDesignHandle) designHandle.getModuleHandle();
CssStyleSheetHandle css = report.openCssStyleSheet("path/to/my/css/report.css");
report.addCss(css);
} catch (Exception e) {
e.printStackTrace();
}
}
</pre>