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 set PageBreak Interval by documetn type in rptdesign ?
Elkaras
Hi, I have a problem .. now ..
I think all I've made rptdesign works really fine ...
but it has a big problem..
that is the page break works on excel type document..
the report usually has more than one hundred rows ...
so, the table in the report has page break by 10,
on the web viewer it works really fine ...
but.. excel ... the data has been divided by 10 ..and make other sheets..the divided data on
** I want to set pagebreak interval as 0 , when the rpt design calls when the output format is xls or xlsx..
what should I do ? !
Find more posts tagged with
Comments
Elkaras
has sovled by myself
Select the table and on script section for onPrepare.
first, get the type of output document type.
second, get table Element and set the value of PageBreakInterval.
Here's source..
[onPrepare] - on table element
outputFormatString = reportContext.getOutputFormat();
Packages.java.lang.System.out.println(" BIRT output format :" + outputFormatString);
if(outputFormatString=="xlsx"){
tableContext = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("myTable");
tableContext.setPageBreakInterval(0);
}
//
thanks for reading , have a good day.
mwilliams
Great! Glad you were able to solve this so quickly. Also, thanks for updating the thread! Let us know whenever you have questions!
jbriel
<p>Hi, I am trying to do the same.</p><p> </p><p>I am using <span><span>birt</span></span> 4.3 and I want to set the p[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]age break interval to 0 if the user selected [/color]xls_spudsoft [color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]as the export option.[/color]</p><p> </p><p>I tried adding the following to the table's <span>onPrepare</span> section</p><p>[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]<span><span>outputFormatString[/color]</span> = <span><span>reportContext</span></span><span><span>.</span></span><span><span>getOutputFormat</span></span><span><span>(</span></span>);</span><br />
[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]Packages<span><span>.[/color]</span><span><span>java</span></span><span><span>.</span></span><span><span>lang</span></span><span><span>.</span></span>System<span><span>.</span></span>out<span><span>.</span></span><span><span>println</span></span><span><span>(</span></span>" BIRT output format :" + <span><span>outputFormatString</span></span>);</span><br />
[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]<span><span>if[/color]</span><span><span>(</span></span>outputFormatString=="xls_spudsoft"<span><span>)</span></span>{</span><br />
[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]<span><span>tableContext[/color]</span> = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("myTable");</span><br />
[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]<span><span>tableContext[/color]</span><span><span>.</span></span><span><span>setPageBreakInterval</span></span><span><span>(</span></span>0);</span><br />
[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]} [/color]</p><p>[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]<span><span>but[/color]</span> that did not work for me. Does anyone have an idea what could be wrong?</span></p>
mwilliams
<p>Take a look at the beforeFactory script in this example. The name of the table set in the property editor is "myTable".</p>
jbriel
<p>Hi, thx for the reply. I am getting a weird result. If I run your attached example and <span>printout</span> the OutputFormat it says "PDF" when I run or export the report.</p><p> </p><p>Also for my own report the OutputFormat stays "html" when I use the xls_spudsoft export option.</p><p> </p><p>Any Ideas? Could it be something with my <span>birt</span> environment that's not right?</p>
mwilliams
<p>If you run to the web viewer and then export the report, it runs it as "pdf" format because that's what the web viewer runs as. If you run straight to xls_spudsoft, it should work correctly. Let me try putting the output format in the report and testing.</p>
mwilliams
<p>You could create your own export to XLS option, like in this report.</p>