rapthor Posted December 11, 2009 Share Posted December 11, 2009 Hello,I am exporting a JasperPrint to Excel inside my Java application. The file always contains an empty first column and an empty narrow column after the last data column (like a margin to the left and right of my actual data).How do I remove these blank column automatically?I attached the code that exports my report to Excel.Code: ByteArrayOutputStream baos = new ByteArrayOutputStream(); JRXlsExporter exporterXLS = new JRXlsExporter(); exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT, print); exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, baos); exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.FALSE); exporterXLS.setParameter( JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE); exporterXLS.setParameter( JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE); exporterXLS.setParameter( JRXlsExporterParameter.IS_IGNORE_GRAPHICS, Boolean.TRUE); exporterXLS.setParameter( JRXlsExporterParameter.IS_IGNORE_CELL_BORDER, Boolean.TRUE); exporterXLS.setParameter( JRXlsExporterParameter.IS_COLLAPSE_ROW_SPAN, Boolean.TRUE); exporterXLS.setParameter( JRXlsExporterParameter.SHEET_NAMES, sheetNames); exporterXLS.exportReport(); return baos.toByteArray(); Link to comment Share on other sites More sharing options...
Teodor Danciu Posted December 11, 2009 Share Posted December 11, 2009 Hi, Try the IGNORE_PAGE_MARGINS exporter parameter. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
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