18 Answers:
HTH,
Lucian
I added a new parameter "jfcRenderer", set image expression: $P{jfcRenderer}, both net.sf.jasperreports.engine.JRRenderable as type.
This is test code fragment:
JFreeChart jfreechart = createChart(createDataset());
JFreeChartRenderer jfcRenderer = new JFreeChartRenderer(jfreechart);
try{
String xmlPath = System.getProperty("user.dir")...;
JasperReport jasperReport = JasperCompileManager.compileReport(xmlPath);
Map param = new HashMap();
param.put("jfcRenderer" , jfcRenderer);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, param);
...
but I got a blank export PDF file, no image in it. please tell me how to fix it, thanks.
Post edited by: Kappa, at: 2006/10/13 08:50
Hi,
Please create a new thread instead of posting to an existing thread which might not be related to your current problem.
You get an empty report because you do not provide any data source for the report and the report template has whenNoDataType="NoPages".
Set whenNoDataType="AllSectionsNoDetail" in your report and things should change.
I hope this helps.
Teodor
Hi!
I'm sorry - I've messed it up. I wanted to delete my post and instead of beginning a new thread without noticing that you've already answered.
"whenNoDataType="AllSectionsNoDetail" in your report and things should change."
I've already done this: Abschnitte --> no Data --> Anzeigen wenn "AllSectionsNoDetail", or is this not correct?
Thanks in advance!
Hi!
I've tried to overtake the samples of the code posted before, but when running the report, no pages could be printed, although I have created a new dataset and tried to set whenNoDataType="AllSectionsNoDetail"
Thanks in advance,
Julia
Post Edited by jkalten at 07/13/2009 09:29
Hi!
Thank you - I've found out how to set whenNoDataType="AllSectionsNoDetail".
One thing, I still don't understand is the fact, that I have already defined some data in the ChartTest.java:
public static void createDataset() {
DefaultPieDataset dataset = new DefaultPieDataset();
dataset = new JREmptyDataSource();
dataset.setValue("One", new Double(43.2));
dataset.setValue("Two", new Double(10.0));
dataset.setValue("Three", new Double(27.5));
dataset.setValue("Four", new Double(17.5));
dataset.setValue("Five", new Double(1.8));
return dataset;
}
Isn't this already our datasource?
Thanks in advance - It's my first time to include an exteranal chart with JFreeChart into IReport.
Julia
Post Edited by jkalten at 07/16/2009 08:18
Hi,
You are mixing up things and you need to read the freely available JasperReports documentation to understand what reports are and how they work. Only then you should try put charts in those reports.
Your data represents the JFreeChart dataset required by your chart. It has nothing to do with the data source that the report expects. You are not passing any data source to the report, are you?
Please check the JR API and see there are many other fill methods in the JasperFillManager which take a data source or a connection as parameter. You are using the one that takes no data source or connection.
I'm not even sure why you create the chart object yourself. Didn't you see you can use a chart element and design it visually with the iReport designer? Check the /demo/samples/charts sample provided with the JR project package.
I hope this helps.
Teodor
Hi!
I have created a waterfallchart-diagram with JFreeChart and in connection with .jrxml (diagramm is inserted in the report as an image). I'm working with iReport 3.5.2 and Jasperserver 3.5.0. I know, that this isn't the Jasperserver-forum, but maybe you can give me a hint: I want to be able to execute this report with the appropriate java-File in Jasperserver from the Webbrowser. I have changed the java-file to an executeable .jar File and uploaded it to the repository of Jasperserver as a resource. Then I've connected this resource with that .jrxml File. When executing this report, I just get all the surroundigns, which I have formerly defined in iReports, without the diagram. Which further steps have to be taken, in order to be able to see the diagram there?
Hope you can help me.
Kind regards, Julia
Hi,
Have you tested the report with HTML preview in iReport? It could be that the chart does not appear in HTML because it overlaps with some other content and the HTML is a grid exporter with the limitations mentioned here:
http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/faq.html?group_id=252#FAQ26
I hope this helps.
Teodor
P.S. Even if it appears to be the same problem, it is always better to create a new thread on the forums, instead of adding to what is already a very long discussion.