Dynamic image in report [message #257751] |
Wed, 10 October 2007 03:16  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.28647 seconds