Skip to main content



      Home
Home » Archived » BIRT » IDeviceRenderer bug?
IDeviceRenderer bug? [message #144833] Thu, 16 March 2006 18:34 Go to next message
Eclipse UserFriend
Originally posted by: zerokelvin.gmx.net

hello,
After I finally found where to look at to output my charts I ran into an
exception. I am trying to use the device renderer to output my chart to
a file.


And this is the exception:

org.eclipse.birt.chart.exception.ChartException: $NO-RB$ Source value
can not be null
at org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1214)


Here is the relevant source code:
--snip--
final PluginSettings ps = PluginSettings.instance();

try {
dRenderer = ps.getDevice("dv.GIF");//$NON-NLS-1$

} catch (ChartException ex) {
ex.printStackTrace();
}
BufferedImage img = new BufferedImage(500, 500,
BufferedImage.TYPE_INT_ARGB);
Graphics g = img.getGraphics();

Graphics2D g2d = (Graphics2D) g;
dRenderer.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT, g2d);

dRenderer.setProperty(IDeviceRenderer.FILE_IDENTIFIER,"C:\\ChartImage.gif ");

Bounds bo = BoundsImpl.create(0, 0, 500, 500);
bo.scale(72d / dRenderer.getDisplayServer().getDpiResolution());

Generator gr = Generator.instance();

try {
gcs = gr.build(dRenderer.getDisplayServer(), chart, bo, null, null , null);
gr.render(dRenderer, gcs);
} catch (ChartException e) {
e.printStackTrace();
}
--snip--
IDeviceRenderer bug!!! [message #144855 is a reply to message #144833] Thu, 16 March 2006 19:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zerokelvin.gmx.net

hello,
I found out the following. If I use the serializer.write method on the
chart before I render it with the device renderer, this exception
occurs. Otherwise I could output it on the device renderer. Same for
charts that I have read with the serializer.
But how can I read a chart representation from an xml representation now
and output it to a renderer?
thank you for your help,
hubi

zero kelvin wrote:
> hello,
> After I finally found where to look at to output my charts I ran into an
> exception. I am trying to use the device renderer to output my chart to
> a file.
>
>
> And this is the exception:
>
> org.eclipse.birt.chart.exception.ChartException: $NO-RB$ Source value
> can not be null
> at org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1214)
>
>
> Here is the relevant source code:
> --snip--
> final PluginSettings ps = PluginSettings.instance();
>
> try {
> dRenderer = ps.getDevice("dv.GIF");//$NON-NLS-1$
>
> } catch (ChartException ex) {
> ex.printStackTrace();
> }
> BufferedImage img = new BufferedImage(500, 500,
> BufferedImage.TYPE_INT_ARGB);
> Graphics g = img.getGraphics();
>
> Graphics2D g2d = (Graphics2D) g;
> dRenderer.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT, g2d);
>
> dRenderer.setProperty(IDeviceRenderer.FILE_IDENTIFIER,"C:\\ChartImage.gif ");
>
>
> Bounds bo = BoundsImpl.create(0, 0, 500, 500);
> bo.scale(72d / dRenderer.getDisplayServer().getDpiResolution());
>
> Generator gr = Generator.instance();
>
> try {
> gcs = gr.build(dRenderer.getDisplayServer(), chart, bo, null, null ,
> null);
> gr.render(dRenderer, gcs);
> } catch (ChartException e) {
> e.printStackTrace();
> }
> --snip--
Re: IDeviceRenderer bug!!! [message #144892 is a reply to message #144855] Fri, 17 March 2006 01:58 Go to previous messageGo to next message
Eclipse UserFriend
You need to bind the runtime dataset again after you
serialized/deserialized the chart model. the serialization will
eliminate all the runtime information including the runtime dataset.

Zhiqiang Qian


zero kelvin wrote:
> hello,
> I found out the following. If I use the serializer.write method on the
> chart before I render it with the device renderer, this exception
> occurs. Otherwise I could output it on the device renderer. Same for
> charts that I have read with the serializer.
> But how can I read a chart representation from an xml representation now
> and output it to a renderer?
> thank you for your help,
> hubi
>
> zero kelvin wrote:
>> hello,
>> After I finally found where to look at to output my charts I ran into
>> an exception. I am trying to use the device renderer to output my
>> chart to a file.
>>
>>
>> And this is the exception:
>>
>> org.eclipse.birt.chart.exception.ChartException: $NO-RB$ Source value
>> can not be null
>> at
>> org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1214)
>>
>>
>> Here is the relevant source code:
>> --snip--
>> final PluginSettings ps = PluginSettings.instance();
>> try {
>> dRenderer = ps.getDevice("dv.GIF");//$NON-NLS-1$
>>
>> } catch (ChartException ex) {
>> ex.printStackTrace();
>> }
>> BufferedImage img = new BufferedImage(500, 500,
>> BufferedImage.TYPE_INT_ARGB);
>> Graphics g = img.getGraphics();
>>
>> Graphics2D g2d = (Graphics2D) g;
>> dRenderer.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT, g2d);
>>
>> dRenderer.setProperty(IDeviceRenderer.FILE_IDENTIFIER,"C:\\ChartImage.gif ");
>>
>>
>> Bounds bo = BoundsImpl.create(0, 0, 500, 500);
>> bo.scale(72d / dRenderer.getDisplayServer().getDpiResolution());
>>
>> Generator gr = Generator.instance();
>>
>> try {
>> gcs = gr.build(dRenderer.getDisplayServer(), chart, bo, null, null
>> , null);
>> gr.render(dRenderer, gcs);
>> } catch (ChartException e) {
>> e.printStackTrace();
>> }
>> --snip--
Re: IDeviceRenderer bug!!! [message #144925 is a reply to message #144892] Fri, 17 March 2006 03:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zerokelvin.gmx.net

Thank you for the tip. I already thougt of something like that. But how
can I do this? So far I was only using the chartwizard with my custom
IDataServiceProvider. I dont know what I need to bind now.
hubi

Zhiqiang Qian schrieb:
> You need to bind the runtime dataset again after you
> serialized/deserialized the chart model. the serialization will
> eliminate all the runtime information including the runtime dataset.
>
> Zhiqiang Qian
>
>
> zero kelvin wrote:
>
>> hello,
>> I found out the following. If I use the serializer.write method on the
>> chart before I render it with the device renderer, this exception
>> occurs. Otherwise I could output it on the device renderer. Same for
>> charts that I have read with the serializer.
>> But how can I read a chart representation from an xml representation
>> now and output it to a renderer?
>> thank you for your help,
>> hubi
>>
>> zero kelvin wrote:
>>
>>> hello,
>>> After I finally found where to look at to output my charts I ran into
>>> an exception. I am trying to use the device renderer to output my
>>> chart to a file.
>>>
>>>
>>> And this is the exception:
>>>
>>> org.eclipse.birt.chart.exception.ChartException: $NO-RB$ Source value
>>> can not be null
>>> at
>>> org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1214)
>>>
>>>
>>> Here is the relevant source code:
>>> --snip--
>>> final PluginSettings ps = PluginSettings.instance();
>>> try {
>>> dRenderer = ps.getDevice("dv.GIF");//$NON-NLS-1$
>>>
>>> } catch (ChartException ex) {
>>> ex.printStackTrace();
>>> }
>>> BufferedImage img = new BufferedImage(500, 500,
>>> BufferedImage.TYPE_INT_ARGB);
>>> Graphics g = img.getGraphics();
>>>
>>> Graphics2D g2d = (Graphics2D) g;
>>> dRenderer.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,
>>> g2d);
>>>
>>> dRenderer.setProperty(IDeviceRenderer.FILE_IDENTIFIER,"C:\\ChartImage.gif ");
>>>
>>>
>>> Bounds bo = BoundsImpl.create(0, 0, 500, 500);
>>> bo.scale(72d / dRenderer.getDisplayServer().getDpiResolution());
>>>
>>> Generator gr = Generator.instance();
>>>
>>> try {
>>> gcs = gr.build(dRenderer.getDisplayServer(), chart, bo, null,
>>> null , null);
>>> gr.render(dRenderer, gcs);
>>> } catch (ChartException e) {
>>> e.printStackTrace();
>>> }
>>> --snip--
Re: IDeviceRenderer bug!!! [message #145818 is a reply to message #144925] Sun, 19 March 2006 22:23 Go to previous messageGo to next message
Eclipse UserFriend
You need to implement the interface IDataRowExpressionEvaluator, then
use Generator.bindData(). The IDataServiceProvider is only used by the
Chart Builder at design time.

Zhiqiang Qian


zero kelvin wrote:
> Thank you for the tip. I already thougt of something like that. But how
> can I do this? So far I was only using the chartwizard with my custom
> IDataServiceProvider. I dont know what I need to bind now.
> hubi
>
> Zhiqiang Qian schrieb:
>> You need to bind the runtime dataset again after you
>> serialized/deserialized the chart model. the serialization will
>> eliminate all the runtime information including the runtime dataset.
>>
>> Zhiqiang Qian
>>
>>
>> zero kelvin wrote:
>>
>>> hello,
>>> I found out the following. If I use the serializer.write method on
>>> the chart before I render it with the device renderer, this exception
>>> occurs. Otherwise I could output it on the device renderer. Same for
>>> charts that I have read with the serializer.
>>> But how can I read a chart representation from an xml representation
>>> now and output it to a renderer?
>>> thank you for your help,
>>> hubi
>>>
>>> zero kelvin wrote:
>>>
>>>> hello,
>>>> After I finally found where to look at to output my charts I ran
>>>> into an exception. I am trying to use the device renderer to output
>>>> my chart to a file.
>>>>
>>>>
>>>> And this is the exception:
>>>>
>>>> org.eclipse.birt.chart.exception.ChartException: $NO-RB$ Source
>>>> value can not be null
>>>> at
>>>> org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1214)
>>>>
>>>>
>>>> Here is the relevant source code:
>>>> --snip--
>>>> final PluginSettings ps = PluginSettings.instance();
>>>> try {
>>>> dRenderer = ps.getDevice("dv.GIF");//$NON-NLS-1$
>>>>
>>>> } catch (ChartException ex) {
>>>> ex.printStackTrace();
>>>> }
>>>> BufferedImage img = new BufferedImage(500, 500,
>>>> BufferedImage.TYPE_INT_ARGB);
>>>> Graphics g = img.getGraphics();
>>>>
>>>> Graphics2D g2d = (Graphics2D) g;
>>>> dRenderer.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,
>>>> g2d);
>>>>
>>>> dRenderer.setProperty(IDeviceRenderer.FILE_IDENTIFIER,"C:\\ChartImage.gif ");
>>>>
>>>>
>>>> Bounds bo = BoundsImpl.create(0, 0, 500, 500);
>>>> bo.scale(72d / dRenderer.getDisplayServer().getDpiResolution());
>>>>
>>>> Generator gr = Generator.instance();
>>>>
>>>> try {
>>>> gcs = gr.build(dRenderer.getDisplayServer(), chart, bo, null,
>>>> null , null);
>>>> gr.render(dRenderer, gcs);
>>>> } catch (ChartException e) {
>>>> e.printStackTrace();
>>>> }
>>>> --snip--
Re: IDeviceRenderer bug!!! [message #147090 is a reply to message #145818] Wed, 22 March 2006 11:48 Go to previous message
Eclipse UserFriend
Originally posted by: zerokelvin.gmx.net

Thank you for the tip... I am now using the bindData method from the
UiHelper class (or similar) to bind the Dataset with the
IDataserviceProvider.
I just got confused by the IDataRowExpressionEvaluator but it works fine
now!


Zhiqiang Qian schrieb:
> You need to implement the interface IDataRowExpressionEvaluator, then
> use Generator.bindData(). The IDataServiceProvider is only used by the
> Chart Builder at design time.
>
> Zhiqiang Qian
>
>
> zero kelvin wrote:
>
>> Thank you for the tip. I already thougt of something like that. But
>> how can I do this? So far I was only using the chartwizard with my custom
>> IDataServiceProvider. I dont know what I need to bind now.
>> hubi
>>
>> Zhiqiang Qian schrieb:
>>
>>> You need to bind the runtime dataset again after you
>>> serialized/deserialized the chart model. the serialization will
>>> eliminate all the runtime information including the runtime dataset.
>>>
>>> Zhiqiang Qian
>>>
>>>
>>> zero kelvin wrote:
>>>
>>>> hello,
>>>> I found out the following. If I use the serializer.write method on
>>>> the chart before I render it with the device renderer, this
>>>> exception occurs. Otherwise I could output it on the device
>>>> renderer. Same for charts that I have read with the serializer.
>>>> But how can I read a chart representation from an xml representation
>>>> now and output it to a renderer?
>>>> thank you for your help,
>>>> hubi
>>>>
>>>> zero kelvin wrote:
>>>>
>>>>> hello,
>>>>> After I finally found where to look at to output my charts I ran
>>>>> into an exception. I am trying to use the device renderer to output
>>>>> my chart to a file.
>>>>>
>>>>>
>>>>> And this is the exception:
>>>>>
>>>>> org.eclipse.birt.chart.exception.ChartException: $NO-RB$ Source
>>>>> value can not be null
>>>>> at
>>>>> org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1214)
>>>>>
>>>>>
>>>>> Here is the relevant source code:
>>>>> --snip--
>>>>> final PluginSettings ps = PluginSettings.instance();
>>>>> try {
>>>>> dRenderer = ps.getDevice("dv.GIF");//$NON-NLS-1$
>>>>>
>>>>> } catch (ChartException ex) {
>>>>> ex.printStackTrace();
>>>>> }
>>>>> BufferedImage img = new BufferedImage(500, 500,
>>>>> BufferedImage.TYPE_INT_ARGB);
>>>>> Graphics g = img.getGraphics();
>>>>>
>>>>> Graphics2D g2d = (Graphics2D) g;
>>>>> dRenderer.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,
>>>>> g2d);
>>>>>
>>>>> dRenderer.setProperty(IDeviceRenderer.FILE_IDENTIFIER,"C:\\ChartImage.gif ");
>>>>>
>>>>>
>>>>> Bounds bo = BoundsImpl.create(0, 0, 500, 500);
>>>>> bo.scale(72d / dRenderer.getDisplayServer().getDpiResolution());
>>>>>
>>>>> Generator gr = Generator.instance();
>>>>>
>>>>> try {
>>>>> gcs = gr.build(dRenderer.getDisplayServer(), chart, bo, null,
>>>>> null , null);
>>>>> gr.render(dRenderer, gcs);
>>>>> } catch (ChartException e) {
>>>>> e.printStackTrace();
>>>>> }
>>>>> --snip--
Previous Topic:HTML Test pass report (BIRT)
Next Topic:multiple data sources
Goto Forum:
  


Current Time: Thu May 08 22:24:25 EDT 2025

Powered by FUDForum. Page generated in 0.06159 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top