IBM Cognos 8 Platform > Report Studio
Show an image as derived from a database (url shortcut)
collierd:
Hello
We are storing URL's to images in a SQL database (datatype - varchar(100))
How do I use these on a report?
I've tried a few things
If I just drop and image and change report expression to the URL surrounded by quotes it works
e.g. '..samples/images/image.gif'
Yet, if I create a query with the correct column in and call it image
Then try and use this as a report expression, it fails (doesn't run)
e.g. [Query1].[image]
I've also tried ('[Query1].[image]')
This runs but the image is blank
Am I missing something obvious?
Thanks for any help
Damian.
josepherwin:
OK, there are 2 types of images. one is for Icon (header, footers, banners, etc) which is basically for displaying purposes, but there is also another one for reporting purposes (e.g. associated an image with a record in a database)
depending on the type of image, there is 2 different ways of making it to work.
The one that you've discovered below will basically work if you make the image as an icon.
However, if you want to display it in a list, you will need to:
1. Create a list table
2. From the Toolbox tab in insertable Object, drag Image to the list
3. Next in the property of the Image, you will then need to change the Source Type to be Data Item Value
david.stachon:
...you are actually missing something easy (your approach is sound)
...if you want to use that column as a report expression, then the column needs to part of your list properties. (I assume you're getting a "variable not found error)
select the list > properties > check box on the column that has the image url
...josepherwin's approach works as well....and it's likely the way I would do it too.
blom0344:
--- Quote from: josepherwin on 07 Sep 2009 06:45:43 pm ---OK, there are 2 types of images. one is for Icon (header, footers, banners, etc) which is basically for displaying purposes, but there is also another one for reporting purposes (e.g. associated an image with a record in a database)
depending on the type of image, there is 2 different ways of making it to work.
The one that you've discovered below will basically work if you make the image as an icon.
However, if you want to display it in a list, you will need to:
1. Create a list table
2. From the Toolbox tab in insertable Object, drag Image to the list
3. Next in the property of the Image, you will then need to change the Source Type to be Data Item Value
--- End quote ---
A bit of a late reponse, but we have been dabbling with these issues too and for reference-sake I'll add the following:
The requirement was to have a certain image based on an ID belonging to a property and add the image to a pdf output>
html-item:
--- Code: ---'<iframe src="http://someserver/somefolder/ImageHandler.ashx?id= '+ [Id1] +' &size=SMALL" frameborder="0" scrolling="NO" width="100%" height="100%">You need a Frames Capable browser to view this content.</iframe>'
--- End code ---
works for HTML output only.
image in list:
--- Code: ---'http://someserver/somefolder/ImageHandler.ashx?id= '+ [Id1] +' &size=SMALL'
--- End code ---
Both expressions stored in a data-item in the query . The last approach , however also seems to work for PDF output
MFGF:
If you just want to be able to drag the query item for your image URL into your report and have it display as an image, you can define this in Framework Manager - change the "Display Type" property of the query item from "Value" to "Picture" and republish the package.
MF.
Navigation
[0] Message Index
[#] Next page
Go to full version