Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Need to Create an image from XML Source.
SiddamS
Hi,
I need to create an image on report from XML data Source.
My Steps are :-
1)Create an xml file with image tag where it contains the image byte data.
2)Created the DataSource for this XML
3)Created Data Set:- have one coloumn named as "image".
So I have created Java script Events :-
1)Before Factory :- here we can add the Dynamic elements to the report.But we can't access row["image"].
2)For Data Set onFetch():-retrieving the row["image"] and placing in report context parameter.
3)Created one Static image for OnCreate():- getting the Image Byte code from report context Parameter and creating the file,adding to it as follows.
importPackage( Packages.java.io );
fos = new java.io.FileOutputStream( "E:logFile123456.jpg" );
printWriter = new java.io.PrintWriter( fos );
var myimage=reportContext.getParameterValue("imagedata");
for(var count=0;count< myimage.length();count++)
{
printWriter.println(myimage[count]);
}
File is created successfully,getting Exception as Unhandled Exception.
Could anyone please help me to build this report.
Thanks and Regards
Swetha.
Find more posts tagged with
Comments
JasonW
Can you post the xml file that contains the image?
Jason
mwilliams
The wrong one of the two duplicate threads got removed. Here's the attachment from the other one.
JasonW
This foto.xml does not look like blob data for an image. It is just the same character sequence repeated. Is this a real image?
Jason
JasonW
It appears it is just the same byte array address for each one. How did you create the field. It may be better to base64encode the byte array and write that to your xml tag. You should then be able to write some script in the on create of the image to decode and set the bytes.
Jason
SiddamS
Hi Jason,
Thanks for Reply.I am trying to encode and decode the image with Java Application.Once I Complete this i can provide the xml file with encoded byte data of Image.
So You'r saying that if we place the decoding byte Array at the "OnCreate "Event of image,It should be display on report.
this.data=byte Array.
Is i m correct or plz correct me...........
Thanks and Regards
Swetha.
JasonW
You should be able to do it that way.
Jason
SiddamS
Thanks a lot for your reply.I am able to retreive the image from XML.
JasonW
Good to hear. Can you post your code for others?