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)
Different margin for html and word
dianbo
Hi all,
Is there any way to set different margins for the same report according to the output format.
For example, i will set margins to 0 in html format, whereas 1cm when in word.
Any suggestion?
Thanks
Find more posts tagged with
Comments
Virgil Dodson
Hi dianbo,<br />
<br />
You can use a bit of scripting in the onRender method of the report design to make decisions based on output. Example code is below and a report design is attached.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
dh = reportContext.getReportRunnable().designHandle.getDesignHandle();
mp = dh.findMasterPage("Simple MasterPage");
if (reportContext.getOutputFormat() == "doc") {
mp.getLeftMargin().value = "1in";
} else if (reportContext.getOutputFormat() == "pdf") {
mp.getLeftMargin().value = "2in";
}
</pre>
dianbo
Hi Virgil , thank you very much.
i test the attached file, but i find that the beforeRender method has never been invoked.
I move the code to "initialize" but the value of reportContext.getOutputFormat() is always html.
note that i use jsapi to access report and use tool bar for outputing content.
Thanks.
Virgil Dodson
Hi dianbo, I just tested this by first showing the HTML report in the browser using the Viewer, and then exporting the report to PDF and also found the same thing you did. The onRender method was not called again based on this new PDF format output when using the toolbar.<br />
<br />
If this is a feature important to you, can you log an enhancement for it? Since you are using the JSAPI with the Actuate Viewer, you can log this request through Actuate Support using the link below if you have a support contract... otherwise, you can log this request without a support contract at <a class='bbc_url' href='
http://ted.birt-exchange.org/'>BIRT
Exchange Defect Tracking</a><br />
<br />
Actuate Support<br />
<a class='bbc_url' href='
http://www.birt-exchange.com/be/services/support/'>http://www.birt-exchange.com/be/services/support/</a>
;