| [birt-dev] Source value can not be null |
|
Hi, I am using eclipse 3.1.1 and BIRT 2.0.0
version. I get
“org.eclipse.birt.chart.exception.ChartException: $NO-RB$ Source value
can not be null” exception while loading the Chart.rptdesign file and
rendering it on canvas. Attached is the rptdesign file which I am
trying to load and render. I am able to open this file in
Eclipse’s Report Design perspective and able to preview it without any
error. But while rendering the same on canvas, it
gives exceptions. The code was working fine with BIRT2.0M3
version, and chart was rendering properly without any error. But it’s not working with BIRT 2.0RC
versions and BIRT2.0.0 version. Code that I am using for rendering the
chart: public void paintControl(PaintEvent e) {
Chart chart = null;
try {
// Load chart from file and get it
chart = GraphDesignerUtility.getChart();
if (chart == null) {
// No chart available to render
}
else {
// Create copy of chart which will be used for rendering
Chart chartToRender = (Chart) EcoreUtil.copy( chart );
// Get a SWT device renderer
IDeviceRenderer deviceRenderer = null;
deviceRenderer = PluginSettings.instance().getDevice("dv.SWT");
deviceRenderer.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT, e.gc);
//Make sure we stay in the client area's bounds
Rectangle rect = ((Composite) e.widget).getClientArea();
final Bounds bounds = BoundsImpl.create(rect.x + 2, rect.y + 2,
rect.width - 4, rect.height - 4);
bounds.scale(72d / deviceRenderer.getDisplayServer()
.getDpiResolution());
final Generator gr = Generator.instance( );
RunTimeContext rtc = new RunTimeContext();
// prepare the chart model.
//RunTimeContext rtc = gr.prepare( chartToRender,
//
null,
//
new BIRTScriptClassLoader( ),
//
Locale.getDefault( ) );
//ScriptHandler sh = new ScriptHandler( );
//rtc.setScriptHandler( sh );
//rtc.setEnableScripting( false );
GeneratedChartState state = gr.build( deviceRenderer.getDisplayServer( ),
chartToRender,
bounds,
null,
rtc,
null );
gr.render( deviceRenderer, state );
}
preservedValidChart = chart;
} catch (Exception ex) {
ex.printStackTrace();
graphView.refresh();
} } I also tried calling Generator’s
prepare method, but found the same problem. Exception that application throws: org.eclipse.birt.chart.exception.ChartException:
$NO-RB$ Source value can not be null
at org.eclipse.birt.chart.factory.Generator.render(Generator.java:1214)
at ibsgraphs.graph.listener.GraphPaintListener.paintControl(GraphPaintListener.java:119)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:83)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:867)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:852)
at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1153)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3090)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:3706)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1656)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2711)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at net.ibs.ui.client.IBSJavaClient.run(IBSJavaClient.java:29)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948) Caused by:
java.lang.IllegalArgumentException: Source value can not be null
at org.eclipse.birt.chart.event.PrimitiveRenderEvent.setSourceObject(PrimitiveRenderEvent.java:278)
at
org.eclipse.birt.chart.event.EventObjectCache.getEventObject(EventObjectCache.java:94)
at org.eclipse.birt.chart.factory.RunTimeContext.notifyStructureChange(RunTimeContext.java:243)
at
org.eclipse.birt.chart.render.AxesRenderer.renderPlot(AxesRenderer.java:2173)
at org.eclipse.birt.chart.render.AxesRenderer.render(AxesRenderer.java:191)
at org.eclipse.birt.chart.factory.Generator.render(Generator.java:1209)
... 28 more Please advice. Thank you. Bharat Panchal http://www.patni.com World-Wide Partnerships. World-Class Solutions. _____________________________________________________________________ This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at netadmin@xxxxxxxxx and delete this mail. _____________________________________________________________________ |
Attachment:
Chart.rptdesign
Description: Binary data