Home » Archived » BIRT » Integrating a BIRT Chart into RCP
Integrating a BIRT Chart into RCP [message #257844] |
Wed, 10 October 2007 15:32  |
Eclipse User |
|
|
|
Originally posted by: geoff.simonds.gmail.com
I have been experimenting with integrating the BIRT Charting Engine into
an existing RCP application and am having a little trouble. I have
defined a report that contains a Chart, a Flat File DataSource and a
DataSet from a csv file with the Report Designer and saved it off to a
..rptdesign file. Within an ViewPart, I want to load this design file
and display just the Chart as SVG on an SWT canvas. I have been using
the book "Integrating and Extending BIRT", specifically chapter 14,
Programming with the BIRT Charting APIs, and believe I am close to
getting it to work. The problem I am having is when it comes time to
call Generator.render, I get the following NPE:
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
at
org.eclipse.birt.chart.render.DeferredCacheManager.createDef erredCache(DeferredCacheManager.java:82)
at org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1274)
at
com.loomissayles.birt.chart.ui.test.ChartComposite.paintCont rol(ChartComposite.java:104)
I could include my test code to demonstrate this but figured I would ask
generally first to see if anybody can help me out.
Thanks for any help.
Geoff
|
|
| |
Re: Integrating a BIRT Chart into RCP [message #258254 is a reply to message #257962] |
Sat, 13 October 2007 08:55   |
Eclipse User |
|
|
|
Originally posted by: geoff.simonds.gmail.com
Hmmm, either everybody is very busy or I have asked a question that
doesn't warrant a response. Is this the correct group to ask my question?
Geoff
Geoff Simonds wrote:
> So I am guessing now that I haven't called bindData to bind the chart
> and the dataset and the nullpointer is happening because the series are
> empty. In looking at the method, Generator.bindData, it isn't clear how
> I call this when I have a scripted dataset. Can someone provide me with
> an example of how to call bindData with a scripted dataset?
>
> Geoff Simonds wrote:
>> I have been experimenting with integrating the BIRT Charting Engine
>> into an existing RCP application and am having a little trouble. I
>> have defined a report that contains a Chart, a Flat File DataSource
>> and a DataSet from a csv file with the Report Designer and saved it
>> off to a .rptdesign file. Within an ViewPart, I want to load this
>> design file and display just the Chart as SVG on an SWT canvas. I
>> have been using the book "Integrating and Extending BIRT",
>> specifically chapter 14, Programming with the BIRT Charting APIs, and
>> believe I am close to getting it to work. The problem I am having is
>> when it comes time to call Generator.render, I get the following NPE:
>>
>> !MESSAGE Unhandled event loop exception
>> !STACK 0
>> java.lang.NullPointerException
>> at
>> org.eclipse.birt.chart.render.DeferredCacheManager.createDef erredCache(DeferredCacheManager.java:82)
>>
>> at
>> org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1274)
>> at
>> com.loomissayles.birt.chart.ui.test.ChartComposite.paintCont rol(ChartComposite.java:104)
>>
>>
>> I could include my test code to demonstrate this but figured I would
>> ask generally first to see if anybody can help me out.
>>
>> Thanks for any help.
>>
>> Geoff
|
|
|
Re: Integrating a BIRT Chart into RCP [message #258322 is a reply to message #257962] |
Mon, 15 October 2007 08:42   |
Eclipse User |
|
|
|
Hi Geoff,
If you create your dataset in a report, I assume you will run the report to
retrieve the data for the chart? In that case, you could embed a browser in
your view to display the report, assuming you only have one chart there. So
you don't need to use the chart API in this scenario.
If however, you're not willing to run the report for performance reasons,
you will need to use the DtE API directly, and I don't think you can reuse
what is created in your report design. Once you have used the DtE API to
create your resultset, you need to wrap the data in an implementation of
IDataRowExpressionEvaluator and pass it to Generator.bindData().
Thanks,
David
"Geoff Simonds" <geoff.simonds@gmail.com> wrote in message
news:feln04$kf$1@build.eclipse.org...
> So I am guessing now that I haven't called bindData to bind the chart and
> the dataset and the nullpointer is happening because the series are empty.
> In looking at the method, Generator.bindData, it isn't clear how I call
> this when I have a scripted dataset. Can someone provide me with an
> example of how to call bindData with a scripted dataset?
>
> Geoff Simonds wrote:
>> I have been experimenting with integrating the BIRT Charting Engine into
>> an existing RCP application and am having a little trouble. I have
>> defined a report that contains a Chart, a Flat File DataSource and a
>> DataSet from a csv file with the Report Designer and saved it off to a
>> .rptdesign file. Within an ViewPart, I want to load this design file and
>> display just the Chart as SVG on an SWT canvas. I have been using the
>> book "Integrating and Extending BIRT", specifically chapter 14,
>> Programming with the BIRT Charting APIs, and believe I am close to
>> getting it to work. The problem I am having is when it comes time to
>> call Generator.render, I get the following NPE:
>>
>> !MESSAGE Unhandled event loop exception
>> !STACK 0
>> java.lang.NullPointerException
>> at
>> org.eclipse.birt.chart.render.DeferredCacheManager.createDef erredCache(DeferredCacheManager.java:82)
>> at org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1274)
>> at
>> com.loomissayles.birt.chart.ui.test.ChartComposite.paintCont rol(ChartComposite.java:104)
>> I could include my test code to demonstrate this but figured I would ask
>> generally first to see if anybody can help me out.
>>
>> Thanks for any help.
>>
>> Geoff
|
|
|
Re: Integrating a BIRT Chart into RCP [message #258345 is a reply to message #258322] |
Mon, 15 October 2007 10:46   |
Eclipse User |
|
|
|
Originally posted by: geoff.simonds.gmail.com
Hi David,
Thanks a lot for responding. My avoidance of running the report is not
due to performance reasons, but rather because I want the output of the
chart to be an svg file, not a pdf or html report. My thinking was that
I would use the report designer just to design the chart and data
sources/sets so that I wouldn't have to do it in code, essentially using
the report design file as a template for all clients to run the same
charts. My rcp app would then read in the design file, extract the
chart, data source and data sets, bind the data and render the chart as
svg. I will look at the DataEngine API to see how I go about creating a
resultset and wrap as an IDataRowExpressionEvaluator. Does anybody know
of any examples of this?
Geoff
David Michonneau wrote:
> Hi Geoff,
>
> If you create your dataset in a report, I assume you will run the report to
> retrieve the data for the chart? In that case, you could embed a browser in
> your view to display the report, assuming you only have one chart there. So
> you don't need to use the chart API in this scenario.
>
> If however, you're not willing to run the report for performance reasons,
> you will need to use the DtE API directly, and I don't think you can reuse
> what is created in your report design. Once you have used the DtE API to
> create your resultset, you need to wrap the data in an implementation of
> IDataRowExpressionEvaluator and pass it to Generator.bindData().
>
> Thanks,
>
> David
>
>
> "Geoff Simonds" <geoff.simonds@gmail.com> wrote in message
> news:feln04$kf$1@build.eclipse.org...
>> So I am guessing now that I haven't called bindData to bind the chart and
>> the dataset and the nullpointer is happening because the series are empty.
>> In looking at the method, Generator.bindData, it isn't clear how I call
>> this when I have a scripted dataset. Can someone provide me with an
>> example of how to call bindData with a scripted dataset?
>>
>> Geoff Simonds wrote:
>>> I have been experimenting with integrating the BIRT Charting Engine into
>>> an existing RCP application and am having a little trouble. I have
>>> defined a report that contains a Chart, a Flat File DataSource and a
>>> DataSet from a csv file with the Report Designer and saved it off to a
>>> .rptdesign file. Within an ViewPart, I want to load this design file and
>>> display just the Chart as SVG on an SWT canvas. I have been using the
>>> book "Integrating and Extending BIRT", specifically chapter 14,
>>> Programming with the BIRT Charting APIs, and believe I am close to
>>> getting it to work. The problem I am having is when it comes time to
>>> call Generator.render, I get the following NPE:
>>>
>>> !MESSAGE Unhandled event loop exception
>>> !STACK 0
>>> java.lang.NullPointerException
>>> at
>>> org.eclipse.birt.chart.render.DeferredCacheManager.createDef erredCache(DeferredCacheManager.java:82)
>>> at org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1274)
>>> at
>>> com.loomissayles.birt.chart.ui.test.ChartComposite.paintCont rol(ChartComposite.java:104)
>>> I could include my test code to demonstrate this but figured I would ask
>>> generally first to see if anybody can help me out.
>>>
>>> Thanks for any help.
>>>
>>> Geoff
>
>
|
|
|
Re: Integrating a BIRT Chart into RCP [message #258421 is a reply to message #258345] |
Mon, 15 October 2007 14:29  |
Eclipse User |
|
|
|
Geoff,
You can render a SVG chart inside a HTML report.
Regarding how to use the DataEngine API, you can take a look at what we have
done in the Chart Builder source code. Here is a few classes you can look
into:
ChartUIUtil.doLivePreview()
ReportDataServiceProvider.getDataForColumns()
Those classes are in the org.eclipse.birt.chart.reportitem.ui plugin.
Thanks,
David
"Geoff Simonds" <geoff.simonds@gmail.com> wrote in message
news:fevug4$iuk$1@build.eclipse.org...
> Hi David,
>
> Thanks a lot for responding. My avoidance of running the report is not
> due to performance reasons, but rather because I want the output of the
> chart to be an svg file, not a pdf or html report. My thinking was that I
> would use the report designer just to design the chart and data
> sources/sets so that I wouldn't have to do it in code, essentially using
> the report design file as a template for all clients to run the same
> charts. My rcp app would then read in the design file, extract the chart,
> data source and data sets, bind the data and render the chart as svg. I
> will look at the DataEngine API to see how I go about creating a resultset
> and wrap as an IDataRowExpressionEvaluator. Does anybody know of any
> examples of this?
>
> Geoff
>
> David Michonneau wrote:
>> Hi Geoff,
>>
>> If you create your dataset in a report, I assume you will run the report
>> to retrieve the data for the chart? In that case, you could embed a
>> browser in your view to display the report, assuming you only have one
>> chart there. So you don't need to use the chart API in this scenario.
>>
>> If however, you're not willing to run the report for performance reasons,
>> you will need to use the DtE API directly, and I don't think you can
>> reuse what is created in your report design. Once you have used the DtE
>> API to create your resultset, you need to wrap the data in an
>> implementation of IDataRowExpressionEvaluator and pass it to
>> Generator.bindData().
>>
>> Thanks,
>>
>> David
>>
>>
>> "Geoff Simonds" <geoff.simonds@gmail.com> wrote in message
>> news:feln04$kf$1@build.eclipse.org...
>>> So I am guessing now that I haven't called bindData to bind the chart
>>> and the dataset and the nullpointer is happening because the series are
>>> empty. In looking at the method, Generator.bindData, it isn't clear how
>>> I call this when I have a scripted dataset. Can someone provide me with
>>> an example of how to call bindData with a scripted dataset?
>>>
>>> Geoff Simonds wrote:
>>>> I have been experimenting with integrating the BIRT Charting Engine
>>>> into an existing RCP application and am having a little trouble. I
>>>> have defined a report that contains a Chart, a Flat File DataSource and
>>>> a DataSet from a csv file with the Report Designer and saved it off to
>>>> a .rptdesign file. Within an ViewPart, I want to load this design file
>>>> and display just the Chart as SVG on an SWT canvas. I have been using
>>>> the book "Integrating and Extending BIRT", specifically chapter 14,
>>>> Programming with the BIRT Charting APIs, and believe I am close to
>>>> getting it to work. The problem I am having is when it comes time to
>>>> call Generator.render, I get the following NPE:
>>>>
>>>> !MESSAGE Unhandled event loop exception
>>>> !STACK 0
>>>> java.lang.NullPointerException
>>>> at
>>>> org.eclipse.birt.chart.render.DeferredCacheManager.createDef erredCache(DeferredCacheManager.java:82)
>>>> at org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1274)
>>>> at
>>>> com.loomissayles.birt.chart.ui.test.ChartComposite.paintCont rol(ChartComposite.java:104)
>>>> I could include my test code to demonstrate this but figured I would
>>>> ask generally first to see if anybody can help me out.
>>>>
>>>> Thanks for any help.
>>>>
>>>> Geoff
>>
|
|
|
Goto Forum:
Current Time: Tue Jul 08 20:43:15 EDT 2025
Powered by FUDForum. Page generated in 0.10089 seconds
|