How to modified the report size by code?
Options
Comments
-
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");Warning No formatter is installed for the format ipb0 -
<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!!~0 -
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>Warning No formatter is installed for the format ipb0 -
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,0 -
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>Warning No formatter is installed for the format ipb0
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 103 General Questions
- 123 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 123 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax