[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.birt] Re: How to access the underlying chart object in a report design

Stuart,

Try
ReportDesignHandle rdh =(ReportDesignHandle) design.getDesignHandle( );
ExtendedItemHandle chart = (ExtendedItemHandle) rdh.findElement("mychart" );
IReportItem item = chart.getReportItem();
Chart cm = (Chart)item.getProperty("chart.instance");


Jason			

Stuart Roe wrote:
Can anyone help me with accessing the underlying chart object within the design returned from <engine>.openReportDesign(..).

I have managed to locate the ExtendedItem object for the chart within the design and I'm able to see the reference Chart object (cm) within the debugger but I'm unable to locate a method to return the reference.

The boiled down version of my code currently consists of:

design = beng.getEngine().openReportDesign("test.rptdesign");
DesignElementHandle dh = design.getDesignHandle();
DesignElement chartDE = dh.getModule().findElement("Chart");
ExtendedItem chartEI = (ExtendedItem)chartDE;
IReportItem elementRI = chartEI.getExtendedElement();

I can see the cm member with elementRI (typed ChartReportItemImpl), but I'm unable to access it.

Why am I doing this?
I'm creating a library which will allow our development staff to use BIRT to define various charts and reports (including the appropriate SQL). These will be loaded into our application when the user selects various options.


With the charts, these will be presented to the user as part of the page. If I can get the chart object I think that I'll be able to render the chart straight into a swing component.

The reports will be rendered to HTML and displayed via an integrated browser window.

Thanks for any help,

Stuart.