Jump to content
We've recently updated our Privacy Statement, available here ×

How to set MS Excel sheet margins?


verter

Recommended Posts

To build reports I'm using JasperReport & iReport. I've created report template in iReport and used JRXlsExporter class for data export to MS Excel. All work fine, but I can't set margins and headlines size of excel sheet. How can I do this?

 

Dmitry.

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

codyjasperForge:

Check the iReport src folder for the Excel exporter class

 

I'm already using exporter class - JRXlsExporter, but I can't find its method or something else to set Excel sheet margins.

 

version of iReport is 1.3.0

version of jasperReports is 1.3.0

Post edited by: verter, at: 2007/07/27 07:13

Link to comment
Share on other sites

Hi,

 

There are two Excel exporters available in JasperReports: JRXlsExporter and JExcelApiExporter.

Neither have any parameter for setting the margins.

Is it about the margins when printing the sheet?

 

In any case, if setting these margins is not supported by the Excel generating library (POI and/or JExcelAPI) then there is nothing much we can do in JR.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

  • 2 years later...

Hi Teodor, thanks for the reply.

Has the situation been changed since 2007?

I encountered the same problem in the current version (3.7.1) of JR/iReport:

  • JRXlsExporter always set XLS page margins (I mean Excel page setup params) to something like 1.9/2.5 cm for left/top (rigth/bottom)
  • JExcelApiExporter always set them to 0/0 cm

So if 1.9/2.5 are very big for me, I encoraged to use only JExcelApiExporter and set IGNORE_PAGE_MARGINS=FALSE then margins are emulated by adding empty cells with correspondent width/height.

So is it still bottleneck in underlying libs (POI, JExcel API)?

Do I use correct workaround for the problem?

 

Thanks in advance.

Link to comment
Share on other sites

  • 7 months later...

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...