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)
Amend Page Break Interval programatically for various output types
baeman
Hi,
Up front, to confirm, I am using 2.2.2.
I would like to set the page interval to 25 for PDF export and to 0 for CSV export.
The closest I have achieved under my own endeavours is the below piece of code in the onRender section, against the table element:
tableContext = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("MyTable");
tableContext.setPageBreakInterval(0);
There seems to be much commentary debating if what I am attempting is possible.
In my initial attempts I have found that defining this code in event handlers for CSV and PDF emitter buttons does not work - the value is set with whatever code executes first and this figure applies to all exports.
Please somebody point me in the right direction!
Thanks,
Find more posts tagged with
Comments
mwilliams
Hi baeman,
Try something like this in your beforeFactory event of your report:
if (reportContext.getOutputFormat() == "pdf"){
tableContext = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("MyTable").setProperty("pageBreakInterval",25);
}
Since we change it to 25 above if the outputFormat is PDF, then you would just set it to 0 as default in the designer for when you do CSV. Hope this helps.
baeman
Hi Michael,
Thanks for the candidate solution.
I found that specifying pdf in uppercase got it to work.
Thanks again!
mwilliams
Great! Glad to help. Let us know whenever you have questions!