COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Veronis on 19 Jul 2010 01:36:47 PM

Title: Dynamic image based on user name
Post by: Veronis on 19 Jul 2010 01:36:47 PM
Hey all :)

I'm making a few reports that require me to display an "electronic signature" image at the bottom of the report. This signature is literally a scanned copy of the person's signature in JPG or PNG format, and thus, this image file will change depending on which user completed the report.

I'm not really sure how to do this. Can anyone give me some direction?

In case the first paragraph wasn't clear, let's say there are two users, AMILLER and MSMITH. If MSMITH runs the report, the JPG signature image on the bottom of the report should be Mike Smith's signature (e.g., msmith.jpg). If AMILLER runs the same report the next month, then Allen Miller's JPG signature image (e.g., amiller.jpg) should be at the bottom instead.

I've got the "user name" field loaded into the query subject that's linked to the report in question, now all I have to do is figure out a way to input an image based on that user name.
Title: Re: Dynamic image based on user name
Post by: CognosPaul on 19 Jul 2010 04:35:04 PM
It's fairly simple.

Drag a singleton into the report. Set it to the query that has the username. Add the username to the properties of the singleton (in the properties list there is a row called Properties).

Drag an image into the singleton. In the image set the source type to Report Expression. Click on the ellipse on the next row and enter:
'../images/' + [Query1].[Username] + '.jpg'

I'm making a few assumptions there, but they're self explanatory.
Title: Re: Dynamic image based on user name
Post by: Veronis on 20 Jul 2010 11:52:17 AM
Awesome, thanks so much! It worked like a charm.