Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Chart incomplete in PDF
icon5.gif  Chart incomplete in PDF [message #780666] Wed, 18 January 2012 18:00 Go to next message
Leticia Simental is currently offline 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: inPreview.jpg
    (Size: 20.77KB, Downloaded 120 times)
  • Attachment: inPDF.jpg
    (Size: 13.24KB, Downloaded 117 times)
Re: Chart incomplete in PDF [message #780885 is a reply to message #780666] Thu, 19 January 2012 14:28 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 #780892 is a reply to message #780885] Thu, 19 January 2012 15:01 Go to previous messageGo to next message
Leticia Simental is currently offline Leticia Simental
Messages: 16
Registered: January 2012
Junior Member
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!
  • Attachment: report.txt
    (Size: 146.88KB, Downloaded 116 times)
Re: Chart incomplete in PDF [message #780895 is a reply to message #780892] Thu, 19 January 2012 15:10 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 #780897 is a reply to message #780895] Thu, 19 January 2012 15:43 Go to previous messageGo to next message
Leticia Simental is currently offline Leticia Simental
Messages: 16
Registered: January 2012
Junior Member
I changed the datatype to integer, but still get the same error Sad

i can send you my entire project to an email if is necessary

Thanks for your help
Re: Chart incomplete in PDF [message #780900 is a reply to message #780897] Thu, 19 January 2012 15:57 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 #788491 is a reply to message #780892] Wed, 01 February 2012 16:58 Go to previous messageGo to next message
Jesh Stha is currently offline Jesh Stha
Messages: 13
Registered: February 2012
Location: Toronto
Junior Member
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 !

PDF
index.php/fa/6975/0/

HTML
index.php/fa/6976/0/

Thank you
  • Attachment: 1.png
    (Size: 22.20KB, Downloaded 551 times)
  • Attachment: 2.png
    (Size: 10.83KB, Downloaded 537 times)

[Updated on: Wed, 01 February 2012 16:59]

Report message to a moderator

Re: Chart incomplete in PDF [message #789218 is a reply to message #788491] Thu, 02 February 2012 13:47 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 16:23 Go to previous messageGo to next message
Leticia Simental is currently offline 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 11:11 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 #799381 is a reply to message #799221] Wed, 15 February 2012 15:29 Go to previous messageGo to next message
Leticia Simental is currently offline Leticia Simental
Messages: 16
Registered: January 2012
Junior Member
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 #800176 is a reply to message #799381] Thu, 16 February 2012 14:44 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 #800317 is a reply to message #800176] Thu, 16 February 2012 18:39 Go to previous messageGo to next message
Leticia Simental is currently offline Leticia Simental
Messages: 16
Registered: January 2012
Junior Member
Hi Jason, thanks a lot but...

Still not working, i changed the datatype as String (for all the columns), got the same error:

Feb 16, 2012 4:59:02 PM org.eclipse.birt.chart.internal.datafeed.ResultSetWrapper initializeMeta
WARNING: Unable to determine data types from resultset


Something that i forgot mention is that 'Point' is the data for Axis-Y, Axis X is filled correctly with column 'Section'


Ammm, the chart does not work, with or without tables

I try restarted a new report from the beginning, really don't understand why doesn't work.... Confused

Attached the rptdesign
Re: Chart incomplete in PDF [message #800329 is a reply to message #800317] Thu, 16 February 2012 19:03 Go to previous messageGo to next message
Leticia Simental is currently offline Leticia Simental
Messages: 16
Registered: January 2012
Junior Member
Sorry, wrong file...

Here the good one
Re: Chart incomplete in PDF [message #800972 is a reply to message #800329] Fri, 17 February 2012 14:19 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 #800981 is a reply to message #800972] Fri, 17 February 2012 14:30 Go to previous messageGo to next message
Leticia Simental is currently offline Leticia Simental
Messages: 16
Registered: January 2012
Junior Member
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 #800995 is a reply to message #800981] Fri, 17 February 2012 14:51 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 #801003 is a reply to message #800995] Fri, 17 February 2012 15:08 Go to previous messageGo to next message
Leticia Simental is currently offline Leticia Simental
Messages: 16
Registered: January 2012
Junior Member
Hi Jason

Here the results:

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

Thanks!
Re: Chart incomplete in PDF [message #801013 is a reply to message #801003] Fri, 17 February 2012 15:21 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 76 times)
Re: Chart incomplete in PDF [message #801031 is a reply to message #801013] Fri, 17 February 2012 15:50 Go to previous messageGo to next message
Leticia Simental is currently offline Leticia Simental
Messages: 16
Registered: January 2012
Junior Member
Same result... Sad

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 #801101 is a reply to message #801031] Fri, 17 February 2012 17:59 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 #801106 is a reply to message #801101] Fri, 17 February 2012 18:12 Go to previous messageGo to next message
Leticia Simental is currently offline Leticia Simental
Messages: 16
Registered: January 2012
Junior Member
Sure, here:
  • Attachment: report.pdf
    (Size: 10.18KB, Downloaded 89 times)
Re: Chart incomplete in PDF [message #801222 is a reply to message #801106] Fri, 17 February 2012 22:31 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 104 times)
Re: Chart incomplete in PDF [message #803061 is a reply to message #801222] Mon, 20 February 2012 16:58 Go to previous message
Leticia Simental is currently offline Leticia Simental
Messages: 16
Registered: January 2012
Junior Member
Hi Jason

It works!!! Very Happy

I guess i have some errors in my project...

i will check and let you know

Thanks a lot!
Previous Topic:Erroneous Handlers - BIRT 3.7.1
Next Topic:Setting jdbc fetch size for dataset
Goto Forum:
  


Current Time: Thu Jul 31 03:38:10 EDT 2014

Powered by FUDForum. Page generated in 0.02716 seconds