plunavat Posted February 7, 2018 Share Posted February 7, 2018 Hello,I am using scatter chart and printing the same to pdf using JASPERREPORT (as i need to show other data)I am creating collection as followspublic FamilyChartSheet(Tbl12ModelPerformance tbl12ModelPerformance,JFreeChart chart) { this.tbl12ModelPerformance = tbl12ModelPerformance; this.chart = new JCommonDrawableRenderer(chart); if (this.tbl12ModelPerformance != null) { Tbl09Performancecurvemaster tbl09Performancecurvemaster = this.tbl12ModelPerformance .getTbl09Performancecurvemaster(); Tbl02Modelmaster tbl02Modelmaster = this.tbl12ModelPerformance.getTbl02Modelmaster(); this.pumpModel = tbl02Modelmaster.getPumpModel(); this.performanceCurveNo = tbl09Performancecurvemaster.getPerformanceCurveNo(); this.mounting = tbl02Modelmaster.getTbl01Pumptype().getMounting(); this.suction = tbl02Modelmaster.getSuction(); this.discharge = tbl02Modelmaster.getDischarge(); this.uomDimension = "mm"; this.minStage = tbl02Modelmaster.getMinStage(); this.maxStage = tbl02Modelmaster.getMaxStage(); this.stageType = tbl02Modelmaster.getStageType(); } }[/code] Code to generate pdf public void PDFExporterOfferPath(Collection<?> beanCollection, String jasperpath, String path, Map<String, Object> parameters1) { try { JRBeanCollectionDataSource beanCollectionDataSource = new JRBeanCollectionDataSource(beanCollection); JasperPrint jasperPrint = JasperFillManager.fillReport(getReportPathCompany() + jasperpath, parameters1, beanCollectionDataSource); ArrayList<JasperPrint> jasperPrintList = new ArrayList<JasperPrint>(); jasperPrintList.add(jasperPrint); File file1 = new File(path); if (!file1.exists()) { file1.createNewFile(); } OutputStream output = new FileOutputStream(file1); JRPdfExporter exporter = new JRPdfExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, jasperPrintList); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, output); exporter.exportReport(); output.flush(); output.close(); } catch (Exception ex) { ex.printStackTrace(); } }[/code]The pdf when opened in Acrobat Reader in Android Mobile App shows following (chart is showing red colour box) When the pdf is opened in Drive Pdf Viewer or WPS Office Viewer then the pdf display is ok Could you please let me know the issueI am using jasperReport 5.6.0, jfreechart 1.0.14 Link to comment Share on other sites More sharing options...
sibin_p Posted September 15, 2018 Share Posted September 15, 2018 @plunavat, did you get any solution for this problem? 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