Jump to content

Recommended Posts

Posted

hi all,

is it possible to remove margins from Excel file ? or change margin size ?

i tried to do this but it does not helkp me :

JRXlsExporter exporter = new JRXlsExporter();           
ByteArrayOutputStream xlsReport = new ByteArrayOutputStream();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, xlsReport);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE, path);
exporter.setParameter(JRExporterParameter.IGNORE_PAGE_MARGINS, Boolean.TRUE);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, name);

exporter.exportReport();
byte bytes[] = xlsReport.toByteArray();
xlsReport.close();
OutputStream ouputStream = new FileOutputStream(path + File.separator + name);
ouputStream.write(bytes, 0, bytes.length);
ouputStream.flush();
ouputStream.close();

 

after this variable isIgnoreMarginPage into exporter instance is false ... why ?

 

_____________________

Regards,

Paata Lominadze.

Magticom LTD.

  • Replies 14
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Thanks for reply.

I use JR 3.5.2 but i tried also older versions.

 

____________________

Regards,

Paata Lominadze.

Magticom LTD.

Posted

Apparently IGNORE_PAGE_MARGINS does not remove left and right page margins when IS_ONE_PAGE_PER_SHEET is not set.  Log this as a bug.

As a workaround, you can set JRXlsAbstractExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS to true.

Regards,

Lucian



Post Edited by lucianc at 06/12/2009 15:43
Posted

hi again,

i tryed everything but no success.

here is my code :

 

JRXlsExporter exporter = new JRXlsExporter();
                ByteArrayOutputStream xlsReport = new ByteArrayOutputStream();
                exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, jasperPrintList);
                exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, xlsReport);
                exporter.setParameter(JRExporterParameter.OUTPUT_FILE, path);
                exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, name);
                exporter.setParameter(JRExporterParameter.IGNORE_PAGE_MARGINS, Boolean.TRUE);               
                exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);
                exporter.setParameter(JRXlsAbstractExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS, Boolean.TRUE);
                exporter.exportReport();

 

but margins still appeard ,,, what is here incorrect

 

IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS didn't help me ..

 

i need to decrease size of margins or remove (left and right) but i can't :(

 

___________________

Regards,

Paata Lominadze.

Magticom LTD.

Posted

hi again lucianc

here is my jrxml and xls

 

Thank you very much again :)

 

 

____________________

Regards,

Paata Lominadze.

Magticom LTD.

Posted

I ran your report with IGNORE_PAGE_MARGINS and IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS set to true, and the margins were removed.  Did you use different export parameters?  Also make sure that you don't have an old JR jar on your classpath.

Regards,

Lucian

Posted

As posted above, I have tried your report but haven't reproduced the problem.  Please post more details on how to replicate the issue (code to fill the report, etc).

Regards,

Lucian

  • 10 months later...
  • 14 years later...
Posted
On 6/12/2009 at 5:42 PM, lucianc said:

Apparently IGNORE_PAGE_MARGINS does not remove left and right page margins when IS_ONE_PAGE_PER_SHEET is not set.  Log this as a bug.

As a workaround, you can set JRXlsAbstractExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS to true.

Regards,

Lucian

 


Post Edited by lucianc at 06/12/2009 15:43

 

this is still there in version 6.18.1. 

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