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 follows
Code: Select all
public 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: Select all
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();
}
}
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 issue
I am using jasperReport 5.6.0, jfreechart 1.0.14
Thanks & Regards,
Pranav C Lunavat