Chart incomplete in PDF [message #780666] |
Wed, 18 January 2012 23:00 |
Leticia Simental Messages: 16 Registered: January 2012 |
Junior Member |
|
|
Hello Community
I have a problem with my BIRT, i'm working in a report to pdf who includes a chart, i'm using scripted datasource...
I have two dataset, one of them should fill the chart's information
I'm sure that both datasets contains information because i put this fields in other section in the report and works ok, show the correct information, but for the chart, i put one field to x-axis and another to y-axis, but only the x-axis are correctly filled, not sure what's the problem...
In 'view report' and 'preview' the chart works ok...
Can you please help me ??
Any ideas??
Thanks a lot!!
-
Attachment: inPDF.jpg
(Size: 13.24KB, Downloaded 261 times) -
Attachment: inPreview.jpg
(Size: 20.77KB, Downloaded 257 times)
|
|
|
Re: Chart incomplete in PDF [message #780885 is a reply to message #780666] |
Thu, 19 January 2012 19:28 |
|
Can you post the design?
Jason
On 1/18/2012 6:00 PM, Leticia Simental wrote:
> Hello Community
>
> I have a problem with my BIRT, i'm working in a report to pdf who includes a chart, i'm using scripted datasource...
>
> I have two dataset, one of them should fill the chart's information
>
> I'm sure that both datasets contains information because i put this fields in other section in the report and works ok, show the correct information, but for the chart, i put one field to x-axis and another to y-axis, but only the x-axis are correctly filled, not sure what's the problem...
>
> In 'view report' and 'preview' the chart works ok...
>
> Can you please help me ??
>
> Any ideas??
>
> Thanks a lot!!
|
|
|
|
Re: Chart incomplete in PDF [message #780895 is a reply to message #780892] |
Thu, 19 January 2012 20:10 |
|
Click on the chart in the report and select the binding tab in the
properties window. Look at the Puntuation field. Why is it set to a
string? Can you change it to an Integer and try again?
Jason
On 1/19/2012 3:01 PM, Leticia Simental wrote:
> I attached a file with the XML Source for the report...
>
> Also i tried with HTMLRender and get this error:
>
>
> + Duplicate aggregation name: COUNT. (Element ID:97)
>
> Duplicate aggregation name: COUNT. ( 1 time(s) )
> detail : org.eclipse.birt.report.engine.api.EngineException: Duplicate aggregation name: COUNT. (Element ID:97)
> at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1214)
> at org.eclipse.birt.report.engine.data.dte.ReportQueryBuilder$QueryBuilderVisitor.visitExtendedItem(ReportQueryBuilder.java:693)
> at org.eclipse.birt.report.engine.ir.ExtendedItemDesign.accept(ExtendedItemDesign.java:45)
> at org.eclipse.birt.report.engine.data.dte.ReportQueryBuilder.build(ReportQueryBuilder.java:256)
> at org.eclipse.birt.report.engine.data.dte.ReportQueryBuilder.build(ReportQueryBuilder.java:237)
> at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.prepare(AbstractDataEngine.java:180)
> at org.eclipse.birt.report.engine.executor.ReportExecutor.execute(ReportExecutor.java:122)
> at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.execute(WrappedReportExecutor.java:60)
> at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplciateReportExecutor.execute(SuppressDuplciateReportExecutor.java:42)
> at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.execute(WrappedReportExecutor.java:60)
> at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:61)
> at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:178)
> at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
> at com.arroba.view.QuestionsView.showReport(QuestionsView.java:553)
> at com.arroba.view.QuestionsView.jbtnNextActionPerformed(QuestionsView.java:500)
> at com.arroba.view.QuestionsView.access$1(QuestionsView.java:484)
> at com.arroba.view.QuestionsView$1.actionPerformed(QuestionsView.java:320)
> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
> at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
> at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
> at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
> at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
> at java.awt.Component.processMouseEvent(Unknown Source)
> at javax.swing.JComponent.processMouseEvent(Unknown Source)
> at java.awt.Component.processEvent(Unknown Source)
> at java.awt.Container.processEvent(Unknown Source)
> at java.awt.Component.dispatchEventImpl(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
> at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
> at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Window.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.EventQueue.dispatchEvent(Unknown Source)
> at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
> at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.run(Unknown Source)
> Caused by: org.eclipse.birt.chart.exception.ChartException: Duplicate aggregation name: COUNT.
>
> Thanks!
|
|
|
|
Re: Chart incomplete in PDF [message #780900 is a reply to message #780897] |
Thu, 19 January 2012 20:57 |
|
If I can run it sure. Send it to jasonweathersby at windstream dot net.
On 1/19/2012 3:43 PM, Leticia Simental wrote:
> I changed the datatype to integer, but still get the same error :(
> i can send you my entire project to an email if is necessary
>
> Thanks for your help
|
|
|
|
Re: Chart incomplete in PDF [message #789218 is a reply to message #788491] |
Thu, 02 February 2012 18:47 |
|
Can you post the design? Have you tried to resize the chart?
Jason
On 2/1/2012 4:58 PM, Jesh Stha wrote:
> Hi,
> I am using Birt 2.5.1.
> For some reason, some of the chart is not properly showing in PDF while its working perfectly in html. I notice that in html display chart y-axis showing correct label
> while in pdf it shows different.
>
> I used scripted data source and chart is in png format.
> Please help
>
>
>
|
|
|
Re: Chart incomplete in PDF [message #798575 is a reply to message #789218] |
Tue, 14 February 2012 21:23 |
Leticia Simental Messages: 16 Registered: January 2012 |
Junior Member |
|
|
Hi Jason, it's me again
I finally can find my problem (is about datatypes), but can't fixed =(
The situation:
I have a dataset who is filled by a POJO
if(count < stock.size()){
row["puntuationChart"] = stock.get(count).getSectionPoint();
row["sectionChart"] = stock.get(count).getSectionName();
row["resultChart"] = stock.get(count).getSectionResults();
count++;
return true;
}
return false;
The column named 'puntuationChart' is the problem.... This column is type=Decimal, and I filled it with a POJO's property type = double, just like this example http: //www.vogella.de/articles/EclipseBIRT/article. html (I did the example and works fine).
The only difference between my project and the example project is that in Java i first have a String, then convert to double and then I set it to the POJO's property:
public List<Answer> getAnswerValues(String answerTot) {
String[] answersStr = answerTot.split(",");
List<Answer> answers = new ArrayList<Answer>();
for (int s = 0; s < answersStr.length; s++) {
Answer answer = new Answer();
double point = Double.parseDouble(answersStr[s]);
answer.setSectionPoint(point);
answers.add(answer);
}
return answers;
}
When I execute the proyect, get this warning:
Feb 14, 2012 3:10:30 PM org.eclipse.birt.chart.internal.datafeed.ResultSetWrapper initializeMeta
WARNING: Unable to determine data types from resultset
But this warning only is showing when the project is executed, when use the BIRT preview works fine
Could you please help me?
Attached the XML Design
|
|
|
Re: Chart incomplete in PDF [message #799221 is a reply to message #798575] |
Wed, 15 February 2012 16:11 |
|
Can you add the following to your fetch:
if(count < stock.size()){
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/temp/datasetevents.txt",
true ) );
out.println( "puntuationChart "+count+"--" +
stock.get(count).getSectionPoint());
out.close();
row["puntuationChart"] = stock.get(count).getSectionPoint();
row["sectionChart"] = stock.get(count).getSectionName();
row["resultChart"] = stock.get(count).getSectionResults();
count++;
return true;
}
And then verify all the data in the datasetevents.txt file?
Jason
On 2/14/2012 4:23 PM, Leticia Simental wrote:
> row["puntuationChart"] = stock.get(count).getSectionPoint();
|
|
|
|
Re: Chart incomplete in PDF [message #800176 is a reply to message #799381] |
Thu, 16 February 2012 19:44 |
|
Try leaving it at a string in the java code:
change this code.
double point = Double.parseDouble(answersStr[s]);
to just return a string for the point. Also if you delete the tables
and only have the chart does it work?
I noticed in your table you changing the type to integer.
Jason
On 2/15/2012 3:29 PM, Leticia Simental wrote:
> Hi Jason
>
> The data looks well, have the information generated in Java:
>
> puntuationChart 0--20
> puntuationChart 1--20
> puntuationChart 2--20
> puntuationChart 3--20
> puntuationChart 4--18
> puntuationChart 5--17
> puntuationChart 6--20
> puntuationChart 7--20
> puntuationChart 8--20
> puntuationChart 9--20
> puntuationChart 10--20
> puntuationChart 11--20
>
>
> also, if i set this information in a table, works OK, the problem is
> only with charts
>
|
|
|
|
|
Re: Chart incomplete in PDF [message #800972 is a reply to message #800329] |
Fri, 17 February 2012 19:19 |
|
I mean to leave it in as a string on the java side but leave it as a
double on the scripted data set. Is there anyway I can run this report?
Jason
On 2/16/2012 7:03 PM, Leticia Simental wrote:
> Sorry, wrong file...
>
> Here the good one
|
|
|
|
Re: Chart incomplete in PDF [message #800995 is a reply to message #800981] |
Fri, 17 February 2012 19:51 |
|
When you write out the data points to a file in the fetch method could
you write out the class type too?
stock.get(count).getSectionPoint().getClass();
Jason
On 2/17/2012 2:30 PM, Leticia Simental wrote:
> I did that too
>
>
> public List<Answer> getAnswerValues(String answerTot) {
> System.out.println("entre");
> String[] answersStr = answerTot.split(",");
> List<Answer> answers = new ArrayList<Answer>();
>
> for (int s = 0; s < answersStr.length; s++) {
> Answer answer = new Answer();
> double point = Double.parseDouble(answersStr[s]);
> answer.setSectionName(strSections[s]);
> answer.setSectionPoint(answersStr[s]);
> System.out.println(answer.getSectionPoint());
> answer.setSectionResults(respuestaBundled(s, (int)point));
>
> answers.add(answer);
> }
> return answers;
> }
>
>
> I have to change the datatype in Java but not in BIRT??
|
|
|
|
Re: Chart incomplete in PDF [message #801013 is a reply to message #801003] |
Fri, 17 February 2012 20:21 |
|
Can you run the attached modified report as a test.
Jason
On 2/17/2012 3:08 PM, Leticia Simental wrote:
> puntuationChart 0--18 class java.lang.String
> puntuationChart 1--19 class java.lang.String
> puntuationChart 2--16 class java.lang.String
> puntuationChart 3--20 class java.lang.String
> puntuationChart 4--20 class java.lang.String
> puntuationChart 5--20 class java.lang.String
> puntuationChart 6--20 class java.lang.String
> puntuationChart 7--20 class java.lang.String
> puntuationChart 8--20 class java.lang.String
> puntuationChart 9--20 class java.lang.String
> puntuationChart 10--20 class java.lang.String
> puntuationChart 11--20 class java.lang.String
-
Attachment: test.zip
(Size: 4.65KB, Downloaded 221 times)
|
|
|
|
Re: Chart incomplete in PDF [message #801101 is a reply to message #801031] |
Fri, 17 February 2012 22:59 |
|
Can you post the pdf output from the sample I sent you?
Jason
On 2/17/2012 3:50 PM, Leticia Simental wrote:
> Same result... :(
> The problem could be in other place, like in ReportEngine code??
>
>
> private void showReport(String pAnswers) {
> IReportEngine engine = null;
> EngineConfig config = null;
> IReportRunnable design = null;
> onfig = new EngineConfig();
> try {
> Platform.startup(config);
> IReportEngineFactory factory = (IReportEngineFactory) Platform
> .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
> engine = factory.createReportEngine(config);
>
> design = engine
> .openReportDesign("C:/Documents and
> Settings/Administrator/workspace/EFY/src/com/arroba/reports/test.rptdesign");
>
>
> IRunAndRenderTask task = engine.createRunAndRenderTask(design);
>
> PDFRenderOption options = new PDFRenderOption();
> options.setOutputFormat(PDFRenderOption.OUTPUT_FORMAT_PDF);
>
> DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
> Date date = new Date();
>
> options.setOutputFileName("C:/report.pdf");
> options.setSupportedImageFormats("PNG;GIF;JPG;BMP;SWF;SVG");
> options.setOutputFormat("pdf");
>
> task.setRenderOption(options);
> task.setParameterValue("rpName", patient.getName());
> task.setParameterValue("rpLastName", patient.getLastName());
> task.setParameterValue("rpAge", patient.getAge());
> task.setParameterValue("rpAnswers", pAnswers);
> task.run();
> task.close();
> engine.destroy();
>
> } catch (Exception ex) {
> ex.printStackTrace();
> } finally {
> Platform.shutdown();
>
> }
> }
|
|
|
|
Re: Chart incomplete in PDF [message #801222 is a reply to message #801106] |
Sat, 18 February 2012 03:31 |
|
Try this code (My output is attached):
import java.util.logging.Level;
import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.EXCELRenderOption;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.EngineConstants;
import org.eclipse.birt.report.engine.api.EngineException;
import org.eclipse.birt.report.engine.api.HTMLRenderOption;
import org.eclipse.birt.report.engine.api.HTMLServerImageHandler;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;
import org.eclipse.birt.report.engine.api.IReportRunnable;
import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
import org.eclipse.birt.report.engine.api.PDFRenderOption;
import org.eclipse.birt.report.engine.api.RenderOption;
import org.eclipse.birt.report.engine.api.impl.RunAndRenderTask;
import org.eclipse.birt.report.engine.api.script.IReportContext;
public class RunAnRender {
public void runReport() throws EngineException
{
RunAndRenderTask task=null;
IReportEngine engine=null;
EngineConfig config = null;
try{
config = new EngineConfig( );
config.setLogConfig("/tmp/dwn", Level.SEVERE);
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
IReportRunnable design = null;
//Open the report design
design = engine.openReportDesign("Reports/testpdf.rptdesign");
task = (RunAndRenderTask) engine.createRunAndRenderTask(design);
IReportContext irc = task.getReportContext();
//task.setParameterValue("Top Count", (new Integer(5)));
//task.validateParameters();
//HTMLRenderOption options = new HTMLRenderOption();
//options.setImageDirectory("./");
//options.setOutputFileName("output/resample/external.html");
//options.setOutputFormat("html");
//options.setEmbeddable(false);
//options.setEnableMetadata(true);
//options.setEnableInlineStyle(false);
//options.setEnableAgentStyleEngine(true);
//options.setEnableCompactMode(true);
PDFRenderOption options = new PDFRenderOption();
options.setOutputFileName("output/resample/testpdf.pdf");
options.setSupportedImageFormats("PNG;GIF;JPG;BMP;SWF;SVG");
options.setOutputFormat("pdf");
//EXCELRenderOption options = new EXCELRenderOption();
//options.setOutputFormat("xls");
//options.setOutputFileName("output/resample/customers.xls");
//options.setWrappingText(true);
//HTMLRenderOption options = new HTMLRenderOption();
//options.setImageHandler(new HTMLServerImageHandler());
//options.setSupportedImageFormats("JPG;PNG;BMP;SVG;GIF");
//options.setOutputFileName("output/external6.doc");
//options.setOutputFormat("doc");
//HTMLRenderOption options = new HTMLRenderOption();
//options.setOutputFormat("ppt");
//options.setOutputFileName("output/resample/ppttest.ppt");
//options.setSupportedImageFormats("PNG;GIF;JPG;BMP;SWF;SVG");
task.setRenderOption(options);
task.run();
irc = task.getReportContext();
task.close();
engine.destroy();
}catch( Exception ex){
ex.printStackTrace();
}
Platform.shutdown( );
System.out.println("Finished");
}
/**
* @param args
*/
public static void main(String[] args) {
try
{
RunAnRender ex = new RunAnRender( );
ex.runReport();
System.exit(0);
}
catch ( Exception e )
{
e.printStackTrace();
}
}
Jason
On 2/17/2012 6:12 PM, Leticia Simental wrote:
> Sure, here:
-
Attachment: testpdf.pdf
(Size: 13.09KB, Downloaded 293 times)
|
|
|
|
Powered by
FUDForum. Page generated in 0.05616 seconds