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 modified the report size by code?
peonest
Hi dear all,
I have a question that how to modified the report size properties by code.
Need your help. Thanks!~
Find more posts tagged with
Comments
Virgil Dodson
Hi peonest,
You can modify the master page properties in the beforeFactory event of the report with something like below.
importPackage( Packages.org.eclipse.birt.report.model.api );
importPackage(Packages.org.eclipse.birt.report.model.api.elements);
importPackage(Packages.org.eclipse.birt.report.model.elements.interfaces);
reportDesignHandle = reportContext.getReportRunnable().designHandle.getDesignHandle();
masterPageHandle = reportDesignHandle.getMasterPages().get(0);
masterPageHandle.setPageType(DesignChoiceConstants.PAGE_SIZE_CUSTOM);
masterPageHandle.setProperty(IReportItemModel.HEIGHT_PROP, "9in");
masterPageHandle.setProperty(IReportItemModel.WIDTH_PROP, "6in");
peonest
<blockquote class='ipsBlockquote' data-author="vdodson"><p>Hi peonest,<br />
<br />
You can modify the master page properties in the beforeFactory event of the report with something like below.<br />
<br />
<br />
importPackage( Packages.org.eclipse.birt.report.model.api );<br />
importPackage(Packages.org.eclipse.birt.report.model.api.elements);<br />
importPackage(Packages.org.eclipse.birt.report.model.elements.interfaces);<br />
<br />
reportDesignHandle = reportContext.getReportRunnable().designHandle.getDesignHandle();<br />
masterPageHandle = reportDesignHandle.getMasterPages().get(0);<br />
<br />
masterPageHandle.setPageType(DesignChoiceConstants.PAGE_SIZE_CUSTOM);<br />
masterPageHandle.setProperty(IReportItemModel.HEIGHT_PROP, "9in");<br />
masterPageHandle.setProperty(IReportItemModel.WIDTH_PROP, "6in");</p></blockquote>
<br />
O, thanks very much!!~
peonest
Hi vdodson,
But I still have a question, do you know how to realize this in Java code instead of JavaScript? Thanks very much for you kindly help!~
Virgil Dodson
Hi peonest,<br />
<br />
I don't have an example, but a Google search revealed a Java class with an example at <a class='bbc_url' href='
http://longlake.minnovent.com/repos/birt_example/birt_api_example/src/deapi/SalesReport.java'>http://longlake.minnovent.com/repos/birt_example/birt_api_example/src/deapi/SalesReport.java</a>
;
peonest
Hi Virgil~
That's what i need exactly!!!! Thank you so much!!
I'm starting to work on the reporting feature for a Tool development. May I have your e-mail address and make a friend with you?
BTW, how can you get such amazing code in the internet by Google, while i couldn't,
Virgil Dodson
Hi peonest,<br />
<br />
You are welcome.<br />
<br />
My email and Yahoo IM info is available on my profile page at: <a class='bbc_url' href='
http://www.birt-exchange.com/userinfo.php?cloned=no&uname=vdodson'>http://www.birt-exchange.com/userinfo.php?cloned=no&uname=vdodson</a>
;