paatal Posted June 6, 2009 Posted June 6, 2009 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.
lucianc Posted June 9, 2009 Posted June 9, 2009 paatalWrote: after this variable isIgnoreMarginPage into exporter instance is false ... why ? Which JR version are you using?Regards,Lucian
paatal Posted June 10, 2009 Author Posted June 10, 2009 Thanks for reply.I use JR 3.5.2 but i tried also older versions. ____________________Regards,Paata Lominadze.Magticom LTD.
lucianc Posted June 12, 2009 Posted June 12, 2009 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,LucianPost Edited by lucianc at 06/12/2009 15:43
paatal Posted June 16, 2009 Author Posted June 16, 2009 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.
lucianc Posted June 17, 2009 Posted June 17, 2009 Could you post a JRXML and an XLS for this?Regards,Lucian
paatal Posted June 24, 2009 Author Posted June 24, 2009 hi again lucianchere is my jrxml and xls Thank you very much again :) ____________________Regards,Paata Lominadze.Magticom LTD.
paatal Posted June 26, 2009 Author Posted June 26, 2009 hi again.did you see my files lucianc?____________________Regards,Paata Lominadze.Magticom LTD.
lucianc Posted June 29, 2009 Posted June 29, 2009 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
lucianc Posted July 1, 2009 Posted July 1, 2009 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
v_i_y Posted May 12, 2010 Posted May 12, 2010 Hi guys. I've encountered the same problem.And I guess the problem is better explained in forum topic:"How to set MS Excel sheet margins?"http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=28559 Just wanted to finalize this thread :)
claudiobosticco Posted November 29 Posted November 29 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now