Chart Appears as red colour in android mobile acrobat Reader

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
plunavat
Posts: 29
Joined: Sun Jan 01, 2012 10:59 am
antibot: No, of course not.

Chart Appears as red colour in android mobile acrobat Reader

Post by plunavat » Wed Feb 07, 2018 4:21 pm

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 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 to generate pdf

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)


Image

When the pdf is opened in Drive Pdf Viewer or WPS Office Viewer then the pdf display is ok


Image

Could you please let me know the issue
I am using jasperReport 5.6.0, jfreechart 1.0.14


Thanks & Regards,
Pranav C Lunavat

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Chart Appears as red colour in android mobile acrobat Re

Post by david.gilbert » Sat Feb 10, 2018 2:07 pm

I would guess that this is a bug in the PDF viewer application, not something related to JFreeChart.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked