Page Break

Re: Page Break

Post by admin » Mon May 20, 2013 12:43 am

New version is available on the Downloads page. We would be glad to get a feedback how single_sheet property works with your reports. Thank you in advance.

Best regards,
Alexey Zhilin
admin
Site Admin
 
Posts: 135
Joined: Fri Nov 05, 2010 2:26 pm
Top

Re: Page Break

Post by AlexA » Wed Jun 25, 2014 9:06 am

Hi I have a problem creating single sheet xslx document.
1. I use the following render options:
EXCELRenderOption option = new EXCELRenderOption();
option.setOutputFormat( EXCEL_RENDER_FORMAT );
option.setEmitterID("com.arctorus.export.birt37x.xlsx");
//option.setOption( IRenderOption.EMITTER_ID, "com.arctorus.export.birt37x.xlsx" );
//these values are not 'magic words', but from the com.arctorus.export.birt37x.xlsx.EmitterConfig
option.setOption( "single_sheet", Boolean.TRUE );
option.setOption( "excel_native_charts", Boolean.FALSE );
option.setEnableMultipleSheet(false);
2. The following user properties on the rtpdesign :
<list-property name="userProperties">
<structure>
<property name="name">single_sheet</property>
<property name="type">string</property>
</structure>
</list-property>
<property name="single_sheet">true</property>
2.1. by the way why the type is string, not Boolean ?
3. It works just fine if my Layout Preference is hard-coded on the rtpdesign as Auto Layout, but as soon as the layout is Fixed Layout - I got multiple sheets.
4. All tables on my rtpdesign have Page Break Interval 0.
5. I tried to set the layout to Auto for Excel only:
reportDocument.getReportDesign().setLayoutPreference(DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_AUTO_LAYOUT);
but it does not have any effect, I still got multiple sheets. It seems only hard-coded Auto Layout has such an effect on the Excel emitter.
6. I use BIRT 4.2.2

Do you have a suggestion how can I set the single sheet for the Excel emitter.
AlexA
 
Posts: 3
Joined: Wed Jun 25, 2014 8:25 am
Top

Re: Page Break

Post by AlexA » Wed Jun 25, 2014 1:30 pm

I try to get Excel output on single sheet.
I have the following setting:
1. BIRT 4.2.2, Excel Emitter: com.arctorus.export.birt37x.xlsx_4.6.2
2. The Render Option:
EXCELRenderOption option = new EXCELRenderOption();
option.setOutputFormat( EXCEL_RENDER_FORMAT );
option.setEmitterID("com.arctorus.export.birt37x.xlsx");
//option.setOption( IRenderOption.EMITTER_ID, "com.arctorus.export.birt37x.xlsx" );
//these values are not 'magic words', but from the com.arctorus.export.birt37x.xlsx.EmitterConfig
option.setOption( "single_sheet", Boolean.TRUE );
option.setOption( "excel_native_charts", Boolean.FALSE );
option.setEnableMultipleSheet(false);

3. On the page I have:
<list-property name="userProperties">
<structure>
<property name="name">single_sheet</property>
<property name="type">string</property>
</structure>
</list-property>
<property name="single_sheet">true</property>

3.1. I tried as well to create EmitterConfig.properties file with one line:
single_sheet=true
but it did not help
3.2. I tried to use fixed layout for all other emitters, but re-set it to the auto for Excel emitter only:
reportDocument.getReportDesign().setLayoutPreference(DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_AUTO_LAYOUT);
it did not help - I still got multiple sheets.
3.3. I tried the following option for the Excel emitter:
option.setOption("layoutPreference","auto" );
still no results.
3.4. It seems that the excel emitter uses only the hard-coded setting for the output.
4. All tables on page have Page Break Interval 0 and Inside Page Break Avoid, Display is Block
5. It all works fine (single sheet is displayed) if I have Layout Preference - Auto Layout, but as soon as my Layout Preference is Fixed - I got multiple sheets.
6. I do not see why the sheets on the emitter should be connected to the Auto Layout only and ignored in the Fixed layout
7. Can you please suggest how can I set single sheet for the Excel emitter if I still want to have Fixed Layout hard-coded on my rtpdesign.

Thanks AlexA
AlexA
 
Posts: 3
Joined: Wed Jun 25, 2014 8:25 am
Top

Re: Page Break

Post by admin » Sat Jun 28, 2014 2:13 pm

Hello Alex,

Thank you for the question.

Actually, that is correct. If you use fixed layout and have hard coded page breaks inside document, in this case BIRT rendering engine insert page breaks before the document loaded into Emitter and it's not possible to change layout. If you use auto-layout, page breaks processed by Emitter and can be removed from the exported document.

If there are no hard coded page breaks in the report it doesn't matter what layout is used and document can be exported on a single page even with fixed layout.

Best regards,
Alexey Zhilin
admin
Site Admin
 
Posts: 135
Joined: Fri Nov 05, 2010 2:26 pm
Top

Re: Page Break

Post by AlexA » Mon Jun 30, 2014 8:31 am

I do not have hard-coded page-breaks inside my rptdesign.
Even more curious that if id do RunAndRender as one operation I got the Excel in one sheet, but as soon as I do Run, which creates rptdocument and use this rptdocument to render - I got the multiple-sheet excel.

I tried the following approach now:
1. I created the rptdesign as "auto layout".
1.1. I added handler to the document:
ReportEventHandler extends ReportEventAdapter
1.2. I overrided the beforeRender function:
public void beforeRender(IReportContext aReportContext)
throws ScriptException {
IRenderOption option = aReportContext.getRenderOption();
boolean isHtml = option.getOutputFormat().equalsIgnoreCase("html");
try {
if (!isHtml) {
aReportContext.getDesignHandle().setLayoutPreference("auto layout");
}
} catch (SemanticException ignore) {

}
}
2. The approach worked fine - I still have the "fixed layout" for HTML and single-sheet for the xlsx.
3. The problem I got now that users can not print the excel as it is , because it became "auto layout" and the columns are just as wide as it gets to fit all the data.
3.1. My point was to get single sheet in the Excel and keep the columns weight as in "fixed layout".
3.2. I still need the way to get Excel in single sheet, but with "fixed" column weight.
3.3. I used "beforeFactory" to set page setup on the Excel and HTML, which works fine for HTML/PDF render, but after I set "auto layout" for Excel Render it got lost as well. The page Size/Orientation is not preserved on the Excel.
public void beforeFactory( IReportDesign report, IReportContext aReportContext ) throws ScriptException {
DesignElementHandle masterPage = aReportContext.getDesignHandle().getMasterPages().get( 0 );
masterPage.setProperty( "type", "US legal" ); //can be "A4"/"US Letter" as well
masterPage.setProperty( "orientation", "portrait");// can be "landscape" as well
}
3.3.1 The setting works just fine for PDF rendering, but in Excel - check the Page Layout (tab) -> Size -> the size/orientation set in the beforeFactory are ignored.
3.3.2 If the page has "fixed layout"- the Size/Orientation are not ignored by the Excel rendering.
4. How can I keep the Excel in single sheet and still have the outlook layout fixed ?
4.1. No hard-coder page-breakes on my pages.
4.2. All tables have Display:block, Page Break: before/inside/after - Avoid, Page Break Interval:0.
4.3. The tables are set inside Grid. Grid has the following setting:
Page Break:before/inside/after - Avoid, Display:Block

Thanks Alex
AlexA
 
Posts: 3
Joined: Wed Jun 25, 2014 8:25 am
Top

Re: Page Break

Post by admin » Mon Jun 30, 2014 3:19 pm

Hello Alex,

Could you please send us (by email preferably) example of generated excel document for investigation and to check what you mean in the point (3.). Also it would be perfect if you can send any simple report as a test case so we could test it on our side. Thank you in advance.

Best regards,
Alexey Zhilin
admin
Site Admin
 
Posts: 135
Joined: Fri Nov 05, 2010 2:26 pm
Top

Previous

Return to Arctorus BIRT Emitters DOCX, XLS, XLSX, CSV, PPTX, ODT, ODS, ODP

Who is online

Users browsing this forum: No registered users and 3 guests

cron
SSL Certificate Authority
SSL Certificate Authority
Credit Card Processing