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

Problem while printing report(having around 20 columns) using JRPrintServiceExporter (on LETTER size


v2phani

Recommended Posts

 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,
Phani
Code:
(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();}
Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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