|
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 |
|
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 #762250 is a reply to message #762242] |
Wed, 07 December 2011 18:55 |
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03775 seconds