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

bharathiraja_rp

Members
  • Posts

    2
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by bharathiraja_rp

  1. Am also facing the same issue. Does anyone have any suggestions!!!
  2. Hi All, We are using jasper report in our web application. When we export the report through code to PDF and if we print the report from the exported PDF document it is fine. But when we export the report to Excel and then print from the exported Excel document the report gets spanned to several pages and printing is incorrect. I am attaching the Excel file and the code am using for exporting. Please help!! Code:public void exportToExcel ( FacesContext facesContext, JasperPrint jasperPrint ) { try { HttpServletResponse response = ( HttpServletResponse ) FacesContext .getCurrentInstance().getExternalContext().getResponse(); response.setHeader( "Content-type", "application/xls" ); response.setHeader( "Content-disposition", "attachment; filename=Report.xls" ); JRXlsExporter xlsExporter = new JRXlsExporter(); xlsExporter.setParameter( JRXlsExporterParameter.JASPER_PRINT, jasperPrint ); xlsExporter.setParameter( JRXlsExporterParameter.OUTPUT_STREAM, response .getOutputStream() ); xlsExporter.exportReport(); } catch ( JRException exception ) { LOGGER.error( "JasperException Found::" + exception.getMessage() ); throwException( facesContext, "error.exporting.report" ); } catch ( IOException exception ) { LOGGER.error( "IOException Found::" + exception.getMessage() ); throwException( facesContext, "error.exporting.report" ); } }
×
×
  • Create New...