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 page size based on parameter
snoland
Is it possible to change the page size in a report progromatically? Sometimes the report needs to be 8.5x11, other times 11x8.5, or 8.5x17 etc.
Find more posts tagged with
Comments
mwilliams
There are probably a few ways to set this in script, but here's one. Put something like this in your initialize method for your report:
reportContext.getDesignHandle().getMasterPages().get(0).setStringProperty("width",params["pageWidth"]);
reportContext.getDesignHandle().getMasterPages().get(0).setStringProperty("height",params["pageHeight"]);
This assumes that you have a string parameters named pageWidth for the width and pageHeight for the height of the page that accept values like "8.5in", "11in", etc. Be sure to set the "Type" on the general tab in the property editor for the masterpage to "Custom" for this to work.