Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Setting report title dynamically and library issue
javadev21
Hi,<br />
<br />
I am using the report title to name a PDF file generated through the ReportEngine. I am using version "birt-runtime-2_6_1".<br />
<br />
In the report "onPageEnd", I am setting the "title" property:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if ( pageNumber == 1 ){
reportContext.getReportRunnable().designHandle.getDesignHandle().setProperty("title", "TEST_TITLE");
}
</pre>
<br />
Then, I'm retrieving the title to name the PDF file through the ReportEngine (reportDesign is of type IReportRunnable):<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
String filename = reportDesign.getDesignHandle().getStringProperty( IReportRunnable.TITLE )
</pre>
<br />
This works fine and filename is "TEST_TITLE" as expected. However, if I use a library in the report, this is not working and filename is null...it seems the "title" property is being set to null somehow. I created a report using the sample database (TestReport.rptdesign) and created a library file (TestLibrary.rptlibrary) and am seeing the same issue. If I don't include TestLibrary in TestReport, the "title" property is being set and retrieved properly through the ReportEngine...However, if I include TestLibrary in TestReport, "title" is null when retrieved. I have attached the TestReport.rptdesign file and for TestLibrary.rptlibrary, I just created an empty library file. Anyone have any issues setting properties and retrieving these properties through ReportEngine when using a library? Thanks for the help.
Find more posts tagged with
Comments
javadev21
I found an old bug that was resolved/fixed which is similar to the problem I'm having:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=199751
The only difference is that I'm trying to get the value for "title" after the report task is run since I'll be using some calculated values in the title which are unknown until after the task is run. When there is a library linked to my report, the value for getStringProperty("title") is null but when I remove the library link, the value for getStringProperty("title") is correct. Anyone else have this issue?