borni Posted February 8, 2011 Share Posted February 8, 2011 helloI use this code to print directly without going through the dialog a statement made by iReport.this code it works well with a inkjet printer, but not with a dot matrix printer.someone can help methank you.code:Code: //fileXml File.jrxmlJasperPrint jasperPrint = fillReports(fileXml); ByteArrayOutputStream pdfReport = new ByteArrayOutputStream(); JRPdfExporter exporter = new JRPdfExporter(); exporter.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, pdfReport); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); JasperPrintManager.printReport(jasperPrint, false); exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE); exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.FALSE); exporter.exportReport(); Link to comment Share on other sites More sharing options...
szaharia Posted February 9, 2011 Share Posted February 9, 2011 Hi,Try to use the JRTextExporter instead of JRPdfExporter.Hope this helps,sanda Link to comment Share on other sites More sharing options...
chalithalawanga Posted December 16, 2014 Share Posted December 16, 2014 Im having a similar question like this. Can you please give me an answer? here is the link to my question http://community.jaspersoft.com/questions/845390/error-when-printing-jasper-report-epson-lx-300ii-printer-windows-7-my-java 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