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)
Images displaying in PDFs?
megabri
I have a birt report that displays an image by using URI. When I run the report as a PDF nothing displays, does any one know how to resolve this issue?
Find more posts tagged with
Comments
mwilliams
Is this the error you're getting? "the resource of this report item is not reachable"? What is your BIRT version?
megabri
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="108259" data-time="1344363337" data-date="07 August 2012 - 11:15 AM"><p>
Is this the error you're getting? "the resource of this report item is not reachable"? What is your BIRT version?<br /></p></blockquote>
I'm not really getting an error. It's just not showing up. I've attached an example. As you can see in the first entry (BirtReportViewer.jpg) the image shows up. When I generate the report as a pdf (BirtPDF.jpg) the images don't display. I'm using version 2.3.2.
megabri
<blockquote class='ipsBlockquote' data-author="'megabri'" data-cid="108260" data-time="1344364167" data-date="07 August 2012 - 11:29 AM"><p>
I'm not really getting an error. It's just not showing up. I've attached an example. As you can see in the first entry (BirtReportViewer.jpg) the image shows up. When I generate the report as a pdf (BirtPDF.jpg) the images don't display. I'm using version 2.3.2.<br /></p></blockquote>
Sorry the attach didn't work on my first post. Lets try this again... i'll just attach them as bmp instead.
megabri
This is the error I'm getting (sorry i just noticed it)
"Aug 7, 2012 2:45:26 PM org.eclipse.birt.report.engine.layout.emitter.PageDeviceRender log
WARNING: For input string: "7001\DOCLINKS\PHOTOS\PC210003.JPG"
java.net.MalformedURLException: For input string: "7001\DOCLINKS\PHOTOS\PC210003.JPG""
I think this has something to do with my link i'm trying to display. The link to the photo should be
http://camsengprd:7001\DOCLINKS\PHOTOS\PC210003.JPG
. In the open script of my data set i have the first line of the query like this (maybe you can find my issue): sqlText = "select replace(filename, '\\\\camsprdactjam1\\d$', '
http://camsengprd:7001')
filename, lirr_seq, description, ownertable, location, reference, lirr_imglayout from ( " +
Thanks
mwilliams
I just checked and I'm not having any issue with PDF and URI images, in 2.3.2. What does your URI look like?
megabri
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="108264" data-time="1344365275" data-date="07 August 2012 - 11:47 AM"><p>
I just checked and I'm not having any issue with PDF and URI images, in 2.3.2. What does your URI look like?<br /></p></blockquote>
My URI is the following: row["filename"].<br />
<br />
This stems from the following query that's in the open script of my dataset:<br />
<br />
<br />
maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());<br />
maximoDataSet.open();<br />
<br />
var sqlText = new String();<br />
<br />
sqlText = "select replace(filename, '\\\\camsprdactjam1\\d$', '<a class='bbc_url' href='
http://camsengprd:7001'>http://camsengprd:7001</a>')
filename, lirr_seq, description, ownertable, location, reference, lirr_imglayout from ( " +<br />
"SELECT urlname filename, doclinks.lirr_seq, lirr_desc description, doclinks.OWNERTABLE, " +<br />
" lirr_photoloc location, '' reference, lirr_imglayout " +<br />
" FROM docinfo, workorder, doclinks " +<br />
" WHERE wonum = '" + params["wonum"] + "' " +<br />
" AND docinfo.DOCINFOID = doclinks.DOCINFOID " +<br />
" AND workorder.workorderid = doclinks.ownerid " +<br />
" and docinfo.doctype = 'PHOTOS' " +<br />
" and doclinks.ownertable = 'WORKORDER' " +<br />
" and workorder.siteid = 'ES' " +<br />
"union " +<br />
"select max(filename) filename, min(lirr_seq) lirr_seq, wm_concat(description) description, ownertable, " + <br />
"wm_concat(DISTINCT location) location, lirr_getphotoref(lirr_wonum, sourcefile) reference, lirr_imglayout from( " +<br />
"select urlname filename, " +<br />
" v_docs.lirr_seq, " + <br />
" v_docs.lirr_desc description, " +<br />
" v_docs.ownertable, " +<br />
" v_docs.lirr_photoloc LOCATION, " + <br />
" v_docs.description sourcefile, " + <br />
" v_docs.document, " +<br />
" v_docs.lirr_imglayout, " +<br />
" real_m.lirr_wonum " +<br />
" from " +<br />
" (SELECT MAX (measurementid) measurementid, lirr_wonum, assetnum, " +<br />
" metername, siteid " +<br />
" FROM measurement GROUP BY lirr_wonum, assetnum, metername, siteid) real_m, " + <br />
" (SELECT a.assetnum, b.lirr_wonum, b.metername, " +<br />
" c.LIRR_SEQ, c.ownertable,c.lirr_desc, c.lirr_photoloc, c.LIRR_IMGLAYOUT, " +<br />
" d.doctype, d.docinfoid, d.document, d.urlname, d.description " +<br />
" FROM asset a, measurement b, doclinks c, docinfo d " +<br />
" WHERE a.assetnum = b.assetnum " +<br />
" AND a.siteid = b.siteid " +<br />
" AND b.lirr_wonum = c.lirr_reference " +<br />
" AND c.docinfoid = d.docinfoid " +<br />
" AND c.ownertable = 'MEASUREMENT' " +<br />
" AND d.doctype = 'PHOTOS' " +<br />
" AND c.ownerid = b.measurementid) v_docs " +<br />
" where real_m.lirr_wonum = v_docs.lirr_wonum " +<br />
" AND real_m.assetnum = v_docs.assetnum " +<br />
" AND real_m.metername = v_docs.metername " +<br />
" AND real_m.lirr_wonum = '" + params["wonum"] + "' " +<br />
" ) " +<br />
" group by lirr_wonum, sourcefile, ownertable, lirr_imglayout " +<br />
")" ;<br />
<br />
<br />
maximoDataSet.setQuery(sqlText);
megabri
I apologize for overwhelming you with posts Mike. I think I see where my issue might possibly be. I have a string replace in my query (which is in my open script of my dataset). The string replace changes out the first part of my link that generates my image to "
http://camsengprd:7001"
. Therefore a full image link should look like this :
http://camsengprd:7001\DOCLINKS\photo1.jpg
. In my birt log its throwing an error which says it's having a problem with the input string 7001\DOCLINKS\photo1.jpg. It seems like it's having problems dealing with the colon after the camsengprd. Any ideas?
mwilliams
If you simply put the static link in for the URI, do you get the image? Like, instead of putting row["filename"], put
http://camsengprd:7001/DOCLINKS/photo1.jpg
. Let me know.
megabri
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="108270" data-time="1344369418" data-date="07 August 2012 - 12:56 PM"><p>
If you simply put the static link in for the URI, do you get the image? Like, instead of putting row["filename"], put <a class='bbc_url' href='
http://camsengprd:7001/DOCLINKS/photo1.jpg.'>http://camsengprd:7001/DOCLINKS/photo1.jpg.</a>
; Let me know.<br /></p></blockquote>
Something weird happens when I hard code the link in (in this example we'll use an actual link I'm using <a class='bbc_url' href='
http://camsengprd:7001\DOCLINKS\PHOTOS\PC210003.JPG'>http://camsengprd:7001\DOCLINKS\PHOTOS\PC210003.JPG</a>)
. When I go to the edit image section and past in the hardcoded link the picture automatically displays under it in the sample box. When I run the report as a PDF though the image doesn't display and I get the following error in my log<br />
<br />
Aug 8, 2012 7:46:37 AM org.eclipse.birt.report.engine.layout.emitter.PageDeviceRender log<br />
WARNING: For input string: "7001\DOCLINKS\PHOTOS\PC210003.JPG"<br />
java.net.MalformedURLException: For input string: "7001\DOCLINKS\PHOTOS\PC210003.JPG"
megabri
My PDF issue was resolved everyone. It turns out the link
http://camsengprd:7001\DOCLINKS\photo1.jpg
didn't work because I had the slashes the wrong way. I did another replace so the link appeared like this:
http://camsengprd:7001/DOCLINKS/photo1.jpg
and it worked. Thanks for everyone's help!
mwilliams
As we discussed in email and I for whatever reason didn't notice, til you emailed me the full url, was that the backslashes needed to be replaced in the URL. I know you know this, but this is for anyone else in the future who looks at this thread.
EDIT: Oops! It appears you already made the summary for me! Thanks!
uttambirt
<p>hi guru , i have the same requirement , but instead of image to be displayed on report , i need the hyperlink to be displayed in the report and if user selects the hyperlink it should connect to the server and should open the attachment file , whether it is PDF or jpg or any thing</p>