Am 26.05.10 12:34, Doan Nguyen Van schrieb:
The draw page of the chart has only one shape (drawPage.getCount()returns
1). I've tried to use the draw page for exporting but It was failed, no
image has been exported.
Ah, I see. Then this is a different problem. The shapes representing the chart are still not generated at the moment of
export. So the result is empty.
I guess if you double click your chart first and then run the exporting code
you will get the wanted result.
Hm, there are different possibilities how to trigger the generation of the
shapes within the given draw page.
I think the best one is to directly request the view to update:
//get the view from the model (there is one view for one model):
XMultiServiceFactory aChartFactory =
(XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class,
aChartDoc);
XUpdatable aChartView = (XUpdatable)UnoRuntime.queryInterface(XUpdatable.class,
aChartFactory.createInstance("com.sun.star.chart2.ChartView"));
//and use interface com.sun.star.util.XUpdatable to trigger the generation of
the shapes
aChartView.update();
Do this before using the exporter.
This is not standard API code, but I don't expect this part of the chart2 API
to change in the next years.
Hope that helps,
Ingrid
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]