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

  • SEARCH
  • Home
  • 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 6359371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:30:33+00:00 2026-05-24T23:30:33+00:00

I have an Excel report that I generate with Jasper 3.7.5 . If I

  • 0

I have an Excel report that I generate with Jasper 3.7.5.
If I preview the file the last column of the report is not shown. enter image description here

If I change the paper size in Page Setup from Letter to A4 then the last column is shown.
enter image description here

When I try to print it, in the Print dialog the first option for paper size is Letter. Is it possible to set the paper size from Jasper in such a way that the Excel would recognize that it is A4 and would set the Paper Size to A4? Or is this only possible in Excel and not in Jasper? It would be nice to have the Paper Size selected to A4 both in the Print dialog and in the preview.

The report width and height (that are set up in the jrxml inside the jasperReport tag) are calculated like this:

// A4 size is 210 mm X 297 mm
int quality = 236; // 236 dpmm = 600 dpi
int width = 210 * quality / 98;
int height = 297 * quality / 98;

I do not know why the formula needs to be divided with 98. However I have noticed that setting the value above 100 has no visible effects on the report.

UPDATE:
The report is in landscape mode.

  • 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-05-24T23:30:34+00:00Added an answer on May 24, 2026 at 11:30 pm

    I could not solve this in Jasper. I have solved it by manipulating the report after it is generated and before it is sent back to browser using the Apache POI API:

    Sheet sheet = workbook.getSheetAt(0);
    sheet.getPrintSetup().setPaperSize(PrintSetup.A4_PAPERSIZE);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an SSRS matrix report that has 4 column groups with the last
I have a website where users generate an Excel report using a macro, when
I have a report to be exported in excel, pdf and word using jasper
I have an excel file, validating one column to enter numbers only but it
I have a PHP script that will generate a report using PHPExcel from data
I have a windows forms application that uses excel to generate some reports. Untill
I have a program that is using the excel interop routines to generate a
Scenario is to generate an excel report that has ~ 150 data columns. Now
I have an accounting program that generates reports and saves them in excel file.
I have an Excel spreadsheet provided as a report, when really its more of

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.