|
|
Re: How to get a Chart from a ReportDesignHandle? [message #757818 is a reply to message #757002] |
Wed, 16 November 2011 15:50 |
|
Once you have the extended item handle check the extension name for
Chart then to get the chart model get the property chart.instance.
ExtendedItemHandle eih = (ExtendedItemHandle) designHandle.getBody( )
.getContents( ).get( 0 );
String name = eih.getExtensionName();
if( name.equalsIgnoreCase("Chart")){
Chart cm = null;
try
{
cm = (Chart) eih.getReportItem( ).getProperty( "chart.instance"); }
catch ( ExtendedElementException e )
{
// TODO Auto-generated catch block
e.printStackTrace( );
}
Jason
On 11/15/2011 5:37 PM, js wrote:
> I have read a .rptdesign file containing a Line Chart into a
> ReportDesignHandle. Now I would like to find this chart through the
> ReportDesignHandle:
>
>
> public static Chart findChart(ReportDesignHandle design) {
> SlotHandle sh = design.getBody();
> Iterator<?> it = sh.iterator();
> while (it.hasNext()) {
> DesignElementHandle de = (DesignElementHandle) it.next();
> DesignElement element = de.getElement();
> if (element instanceof ExtendedItem) {
> ExtendedItem ext = (ExtendedItem) element;
> // How do see that this is a chart?
> }
> }
> return null;
> }
>
>
> It seems that the chart is an extended item, but how do I read it from
> this item?
>
> Or is there a better way to read a Chart from a ReportDesignHandle?
|
|
|
Powered by
FUDForum. Page generated in 0.03420 seconds