Skip to main content



      Home
Home » Archived » BIRT » Dynamic image in report
Dynamic image in report [message #257751] Wed, 10 October 2007 03:16 Go to next message
Eclipse UserFriend
I have to put images in my report dynamicaly. I have the relative path to
the image. I tried to do it with "Dynamic image". In the book I read that
I should create a dataset, that includes the image field, so I created a
DataSet that have the column "image". I set the DataType to "Any". In my
DataSetEventHandler I do following:

File img = new File("/images/test.gif"); (the String should be a variable
later)
dataSetRow.setColumnValue("image", img);

In my report I create a table, insert the image item, select the dynamic
image and enter row["image"] as expression.

The result is a NullPointerException:
at
org.eclipse.birt.data.engine.executor.ResultClass.wasAnyType (ResultClass.java:462)
at
org.eclipse.birt.data.engine.script.DataRow.setColumnValue(D ataRow.java:152)
at
org.eclipse.birt.report.engine.script.internal.UpdatableData SetRow.setColumnValue(UpdatableDataSetRow.java:44)

Did I overlooked something.
Re: Dynamic image in report [message #257780 is a reply to message #257751] Wed, 10 October 2007 08:34 Go to previous message
Eclipse UserFriend
I have found the solution for my problem. I selected the image from URI
instead of Dynamic Image, and the URI was "../.." + relativePath

../.. - i goes to directory 2 levels above
relativePath - is like "/images/test.gif"

> I have to put images in my report dynamicaly. I have the relative path to
> the image. I tried to do it with "Dynamic image". In the book I read that
> I should create a dataset, that includes the image field, so I created a
> DataSet that have the column "image". I set the DataType to "Any". In my
> DataSetEventHandler I do following:

> File img = new File("/images/test.gif"); (the String should be a variable
> later)
> dataSetRow.setColumnValue("image", img);

> In my report I create a table, insert the image item, select the dynamic
> image and enter row["image"] as expression.

> The result is a NullPointerException:
> at
>
org.eclipse.birt.data.engine.executor.ResultClass.wasAnyType (ResultClass.java:462)
> at
> org.eclipse.birt.data.engine.script.DataRow.setColumnValue(D ataRow.java:152)
> at
>
org.eclipse.birt.report.engine.script.internal.UpdatableData SetRow.setColumnValue(UpdatableDataSetRow.java:44)

> Did I overlooked something.
Previous Topic:Using log4j with BIRT
Next Topic:EngineHome
Goto Forum:
  


Current Time: Fri Jul 25 00:39:09 EDT 2025

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

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

Back to the top