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)
change Report Orientation in java code
Hosein
Hi
I'm writing codes that generates a rptdesign file. ReportDesignHandle class hasn't any method to set Report Orientation. How can change Report Orientation in java code ?
Thanks
Find more posts tagged with
Comments
CBR
Report orientation is a property of MasterPageHandle. If you are creating the report using DesignEngine API you have to create a master page first:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
ReportDesignHandle design = session.createDesign( );
// The element factory creates instances of the various BIRT elements.
ElementFactory efactory = design.getElementFactory( );
// Create a simple master page that describes how the report will
// appear when printed.
//
// Note: The report will fail to load in the BIRT designer
// unless you create a master page.
MasterPageHandle masterPage = efactory.newSimpleMasterPage( "Page Master" );
masterPage.setOrientation(DesignChoiceConstants.PAGE_ORIENTATION_PORTRAIT);
masterPage.setPageType(DesignChoiceConstants.PAGE_SIZE_US_LETTER);
design.getMasterPages( ).add( masterPage );
</pre>