I created a report page with A4 format in iReport4.5 and use in java application.
how to change A4 to A5 format on runtime in java application?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Before I show you how to do this, please note that just changing the Page Size is probably not going to give you what your want. It will make the page larger or smaller depending on what you want, put the positioning of elements will not change. IN your case the report may not even compile depending on where you have items laid out.
You do have a couple options though:
at run time grab the appropriate report depending on what you want.
This is probably the easiest solution, but it does mean you end up
with almost 2 identical reports. Meaning any changes in the future
you would have to do in two places.
layout you could use something like Dynamic Jasper to generate your
report in java code.
generate your report at run time.
Now to answer your question. First load up the JRXml file into a
JasperDesignobject:Once you have the
JasperDesignyou can set the page size to what ever you want. A5 paper from what I can tell is 5.83″ × 8.27″. To convert this to a size that JasperReports understands multiply each by 72, getting you 420 x 596 (I rounded as we have to set Integers).From there you cointinue on your exporting adventure as you normally would.