Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » BIRT 3.7 - dynamic image from byte[] bound to column
BIRT 3.7 - dynamic image from byte[] bound to column [message #724609] Mon, 12 September 2011 16:22 Go to next message
Jon Nazario is currently offline Jon NazarioFriend
Messages: 6
Registered: September 2011
Junior Member
Hello there!

I am trying to get dynamic image working in BIRT 3.7 but all I get is either a message: "The resource of this report item is not reachable." or a default image during preview.

Details:
- IDE = RAD 8
- DataSource comes from WebService call to JAX-WS
+ The web service is hosted by WAS 8
+ The web service field uses a DataHandler which responds with a byte[] for the xml document. (i.e. <VirSignatureImage>R0lGODlh9QBgAPcAAAAAAAAAMwAAZgAAmQAAz....[[more data]]</VirSignatureImage>
- In Birt 3.7 for the DataSet I am using SOAP Response = "Use schema from response."
- In Column Mapping, the data type options don't display (Blob or Java Object) so is selected as string
- For the Image as a Dynamic Object is when I see the options to use the dataSetRow["field"] as a Blob or Java Object

Non has work, and haven't found any pointer if the issue is a the beginning with the column data type set to String or how to script to make in java script the field into a byte array.

Thanks for any help
Re: BIRT 3.7 - dynamic image from byte[] bound to column [message #724627 is a reply to message #724609] Mon, 12 September 2011 16:51 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Can you set the binding to string as well and then use some script to
set the values? For example if the image is base64encoded, set the
image type Dynamic Image and use an onCreate script like:


importPackage(Packages.javax.imageio);
importPackage(Packages.java.io);

//this.mimeType = "image/png";
importPackage(Packages.sun.misc);
decoder = new BASE64Decoder();
decodedBytes =
decoder.decodeBuffer(this.getRowData().getColumnValue("yourstringwithimg"));
this.data =decodedBytes;
bais = new ByteArrayInputStream( decodedBytes);
bufimg = ImageIO.read(bais);
this.setHeight(bufimg.getHeight() +"px");
this.setWidth(bufimg.getWidth() +"px");


Jason

On 9/12/2011 12:22 PM, Jon Nazario wrote:
> Hello there!
>
> I am trying to get dynamic image working in BIRT 3.7 but all I get is
> either a message: "The resource of this report item is not reachable."
> or a default image during preview.
>
> Details:
> - IDE = RAD 8 - DataSource comes from WebService call to JAX-WS
> + The web service is hosted by WAS 8
> + The web service field uses a DataHandler which responds with a byte[]
> for the xml document. (i.e.
> <VirSignatureImage>R0lGODlh9QBgAPcAAAAAAAAAMwAAZgAAmQAAz....[[more
> data]]</VirSignatureImage>
> - In Birt 3.7 for the DataSet I am using SOAP Response = "Use schema
> from response."
> - In Column Mapping, the data type options don't display (Blob or Java
> Object) so is selected as string
> - For the Image as a Dynamic Object is when I see the options to use the
> dataSetRow["field"] as a Blob or Java Object
>
> Non has work, and haven't found any pointer if the issue is a the
> beginning with the column data type set to String or how to script to
> make in java script the field into a byte array.
>
> Thanks for any help
>
Re: BIRT 3.7 - dynamic image from byte[] bound to column [message #724639 is a reply to message #724627] Mon, 12 September 2011 17:56 Go to previous messageGo to next message
Jon Nazario is currently offline Jon NazarioFriend
Messages: 6
Registered: September 2011
Junior Member
same behavior, no errors and no image.

How can I see what is occurring internally?

Forgot to add that I am using BIRT viewer as my engine.
Re: BIRT 3.7 - dynamic image from byte[] bound to column [message #724643 is a reply to message #724627] Mon, 12 September 2011 17:57 Go to previous messageGo to next message
Jon Nazario is currently offline Jon NazarioFriend
Messages: 6
Registered: September 2011
Junior Member
Same behavior, no errors and no image.

How can I see what is occurring internally?

Forgot to add that I am using BIRT viewer as my engine.
Re: BIRT 3.7 - dynamic image from byte[] bound to column [message #724644 is a reply to message #724627] Mon, 12 September 2011 17:57 Go to previous messageGo to next message
Jon Nazario is currently offline Jon NazarioFriend
Messages: 6
Registered: September 2011
Junior Member
same behavior, no errors and no image.

How can I see what is occurring internally?

Forgot to add that I am using BIRT viewer as my engine.
Re: BIRT 3.7 - dynamic image from byte[] bound to column [message #724667 is a reply to message #724644] Mon, 12 September 2011 18:43 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Any chance you can post an xml snippet with the image string in it?

Jason

On 9/12/2011 1:57 PM, Jon Nazario wrote:
> same behavior, no errors and no image.
>
> How can I see what is occurring internally?
>
> Forgot to add that I am using BIRT viewer as my engine.
Re: BIRT 3.7 - dynamic image from byte[] bound to column [message #724676 is a reply to message #724667] Mon, 12 September 2011 19:16 Go to previous messageGo to next message
Jon Nazario is currently offline Jon NazarioFriend
Messages: 6
Registered: September 2011
Junior Member
I just realize I had the script in the wrong section. I was thinking the "onCreate" was the name of the javascript for the dynamic image. But playing around found that it was in the actual script tab while having the image focus. After that change, now it works. Smile Thanks SOOOOOOO much!
Re: BIRT 3.7 - dynamic image from byte[] bound to column [message #762242 is a reply to message #724609] Wed, 07 December 2011 18:51 Go to previous messageGo to next message
Jon Nazario is currently offline Jon NazarioFriend
Messages: 6
Registered: September 2011
Junior Member
Hate to revive old posts, but I am having problems reading the image again.. It suddenly stopped working.

In summary I have 2 reports for which this technique works, but for one of the reports it just stopped working.... Nothing blows, but the image doesn't display in the report. I used a .Net client to call the web service and the image returned is good.

So any advice on how to try debug or adjust the code? Also is a GIF image what I am using.
Re: BIRT 3.7 - dynamic image from byte[] bound to column [message #762250 is a reply to message #762242] Wed, 07 December 2011 18:55 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Jon,

What script did you end up using?

Jason

On 12/7/2011 1:51 PM, Jon Nazario wrote:
> Hate to revive old posts, but I am having problems reading the image
> again.. It suddenly stopped working.
>
> In summary I have 2 reports for which this technique works, but for one
> of the reports it just stopped working.... Nothing blows, but the image
> doesn't display in the report. I used a .Net client to call the web
> service and the image returned is good.
>
> So any advice on how to try debug or adjust the code? Also is a GIF
> image what I am using.
Previous Topic:Specifying the number of rows per page
Next Topic:ClassLoader Problem in Event Handler
Goto Forum:
  


Current Time: Fri Apr 26 01:05:18 GMT 2024

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

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

Back to the top