Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7993993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:01:03+00:00 2026-06-04T14:01:03+00:00

I created a report page with A4 format in iReport4.5 and use in java

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:01:04+00:00Added an answer on June 4, 2026 at 2:01 pm

    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:

    1. First you could create a second report for the A5 format, and then
      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.
    2. Second if it is a fairly straight forward report with a typical
      layout you could use something like Dynamic Jasper to generate your
      report in java code.
    3. Lastly you could work directly against the Jasper Report’s API to
      generate your report at run time.

    Now to answer your question. First load up the JRXml file into a JasperDesign object:

    //Note JRXMLLoader could also take a File object or 
    //InputStream instead of a String as the parameter.
    JasperDesign design = JRXmlLoader.load("report.jrxml");
    

    Once you have the JasperDesign you 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).

    design.setPageHeight(596);
    design.setPageWidth(420);
    

    From there you cointinue on your exporting adventure as you normally would.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created an application which outputs a PDF report based on an HTML page
I created a report (using Report Builder 3.0) which has two page newsletter style
i created report in iReport, where is text field with format: new DecimalFormat(#,##0.00).format($F{NUMBER}) +
I have created this report using BIRT and phpjavabridge <?php header(Content-type: application/pdf); header(Content-Disposition: inline;
I've got a report which was created using Crystal Reports. In the page footer
I created a report as part of a C# application using Reporting Services and
I have a report like page which displays a gridview and a chart created
I have a custom built list report page created using Visual force. A link
I created report using reporting, but i am dizzy for case below here are
I created a report using the wizard in SSRS (VS 2008). I wasnt asked

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.