Jump to content

v2phani

Members
  • Posts

    1
  • Joined

  • Last visited

v2phani's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi, I am trying to print the JaspeReports on LETTER size paper, having around 20 columns. Here is the problem: 1. I have some reports, which have around 20 columns. 2. I am trying to print the report, using JRPrintServiceExporter.It is printing only 12 columns, and it is not printing remaining columns at all. 3. I am expecting the remaining 8 columns in the next page, but it is simply cutting-off. 4. I have exported the same report to xls file, and when I opened the exported xls file, and printed the report manually, it prints all the columns separately in 2 pages. Is there any way, by setting some attributes in the program, can I print all the columns in the report. Please help me in resolving this problem. Here is the code, I am using to print the report: Thanks,PhaniCode:(This print exporter is not printing all columns..)public static void printReport(JasperPrint jprint,String obsFilePath) { JRPrintServiceExporter exporter = new JRPrintServiceExporter(); PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet(); printServiceAttributeSet.add(new PrinterName("Canon MP495 series Printer", null)); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jprint); exporter.setParameter(JRExporterParameter.IGNORE_PAGE_MARGINS,true); exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, printServiceAttributeSet); exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE); exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.TRUE); exporter.exportReport();}Here is the code, I am using to export to XLS file (by exporting the file and printing manually it works)public static String generateXLSOutput(String reportName, JasperPrint jasperPrint) throws IOException, JRException { JExcelApiExporter xlsExporter = new JExcelApiExporter(); xlsExporter.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint); String outFileName=FileUtils.getFullReportName(reportName, RepConstants.XLS_EXPORT_FILE_TYPE); xlsExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outFileName); xlsExporter.exportReport();}
×
×
  • Create New...