Jump to content
Changes to the Jaspersoft community edition download ×

Excel export still leaves extra blank rows

Recommended Posts

By: Milton Taylor - ingennia

Excel export still leaves extra blank rows

2002-12-01 21:52



We're exporting to excel with the flag to print all pages to one sheet.


We have turned off top and bottom margins, and suppressed page footers etc, but Jasper still inserts extra whitespace whenever it wants to throw a page. (I guess because it still has a concept of the "page size").


Is there any way to suppress this behaviour? (i.e. to turn off extra col and row insertion that corresponds to white space in a printable report?


Out of interest, is this behaviour specifically encoded in the XLS exporter, in order to make the sheet look like a printed report? Or is this functionality contained in the 'base class' report filler?







By: Teodor Danciu - teodord

RE: Excel export still leaves extra blank rows

2002-12-08 23:18




Yes, the XLS exporter still has the "page size" concept.

Removing page margins and page headers and footers should

produce acceptable results if you want your XLS to have

a continous flow regardless of page breaks.

However, there are cases when extra white space can appear.

For example, if you use the "minHeightToStartNewPage" or

"isStartNewPage" for one of your groups, you have to expect

to have white space everytime the engine starts a new page

to satisfy such a constraint.


Furthermore, every report band is printed at the bottom

of the current page only if the space remaining is at least

equal to the band height and not less.

So, white space might come from the fact that the engine

could not use the remaining available space at the bottom

of the page to start displaying the next band there

and was forced to start a new page, leaving that space unused.


But if you want to push this to the extreme, I'm sure you

can arrange you report design in such a way that a fixed

number of bands fit the given page height. This way you

could be sure that the last remaining space at the bottom of

the page is exactly sufficient for a band to fit into.

This could be achieved by setting a page height that is a multiple

of the detail band height.

For example, if you set pageHeight="800", you can be sure

that exactly 80 detail bands will fit on one page, if the

detail height is 10.

I'm sure real world reports are more complex than that,

but the idea remains.


It is only the XLS exporter class who deals with arranging

elements into a grid. The report filler ("base class") uses

absolute positioning to place elements on the page.

So, you might consider creating you own XLS exported to solve

some of your XLS layout problems if the above suggestions are

not sufficient.


I hope this helps.


Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...