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)
Dynamically setting the MasterPage depending on output format
Jean-Marc
Guys,<br />
I have a report with two very different Master Page depending on the output format so I have ruled out the idea of using the visibility flag.<br />
My report has two master pages MASTER-PDF and MASTER-HTML that need to be used depending on the output format.<br />
I am using birt 2.5.1 and the report viewer installed in tomcat.<br />
<br />
I am writing a Java ReportEventHandler and I have successfully managed to set the master page when using the reportview with the <strong class='bbc'>run option</strong>.<br />
However, when using the same ReportEventHandler with the reportviewer and the <strong class='bbc'>frameset</strong> option, my attempt are unsuccessful.<br />
<br />
What I am doing is the following:<br />
in the beforeRender method, I simply get the report format using reportContext.getOutputFormat();<br />
and set the master page using setProperty("masterPage", "Master-****");<br />
<br />
If I understand properly, the run option uses the RunandRender process. However, the frameset option uses the two phases approach Run then Render. Am I correct?<br />
As said, the approach I am using seems to be working fine with the RunandRender process. However, when using the frameset option, it looks like I am getting the following:<br />
<strong class='bbc'>- in the beforeFactory event, </strong><br />
<br />
the getOuputFormat method returns "html" regardless of the choosen output.<br />
the setProperty("masterPage", "Master-****") seems to be working fine (but I can not choose the right one depending on the output)<br />
<br />
<strong class='bbc'>- in the beforeRender option,</strong><br />
the getOutputFormat seems to be working properly ... however the setProperty("masterPage", "Master-****") has not got any effect.<br />
<br />
Is this behaviour normal? Is there anyway around it? (I would like if possible to avoid having to parse the URL)<br />
Thanks,<br />
Jean-Marc
Find more posts tagged with
Comments
mwilliams
Hi Jean-Marc,
Do you only get this issue when you're running the deployed report? Or is it an issue in the designer too, with the web viewer?
Jean-Marc
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="65819" data-time="1277216626" data-date="22 June 2010 - 07:23 AM"><p>
Hi Jean-Marc,<br />
<br />
Do you only get this issue when you're running the deployed report? Or is it an issue in the designer too, with the web viewer?<br /></p></blockquote>
<br />
Michael,<br />
Thanks for your help. When I use it with the designer, I have the following behaviour:<br />
if I choose view report as PDF, the master page is properly selected.<br />
If I choose view in web browser, the MASTER-HTML is properly selected. However, when I try to print or export the report in PDF using the web browser, the MASTER-PDF pages is NOT used...<br />
<br />
Thanks!<br />
Jean-Marc
mwilliams
Jean-Marc,
This seems like a bug to me. Please log a bug for this at
http://www.birt-exchange.org/org/resources/bug-reporting/
. Thanks!