Cognos Analytics

 View Only

 Personalize Report background image based on parameter

Jump to  Best Answer
Ruben Seror's profile image
Ruben Seror posted Tue August 26, 2025 09:32 AM

Hi all,

I’d like to personalize the background image in Report Studio based on a session parameter. I have at least 100 different values for this parameter.

Is there a way to define a dynamic path for the background image?

Thanks in advance,
Ruben

Michael Webb's profile image
Michael Webb  Best Answer

There may be a way for you to do this if you have the urls as a data item then you can dynamically change the page report background using an HTML item and a css attribute. This means it will not show up in a pdf or excel print outs but will be shown in the browser. 

To do this create an HTML Item and change the 'Source Type' to report expression.Then for the text of the HTML item fill it out as shown below:

'<style>
table[specname=page] {
    background: 
      linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)), 
      url("'+[User Query].[Example URL]+' + '+[User Query].[User Default Name]+'");
    background-position: top left; 
    background-repeat: no-repeat;
    background-size: cover;
}

</style>'

Make sure the query is added to the page or container the HTML item is in so that it can get the data from the report. Also make sure the columns you are using are added to the properties. The query should have a url and any parameters can be in it's own data item. I suggest you build the URL from the HTML Item so you can use the urlencode() function if your user name has special characters that need to be encoded for the url. 

Below are some screen shots of my sample report that you can test with my attachment. 

Yunita Damanik's profile image
Yunita Damanik

If you're looking to change a Cognos report’s background image based on a parameter, Cognos doesn’t support that dynamically. You can set a fixed background image using the APP_BACKGROUND parameter, which applies globally—not per user selection. Cognos does let you customize themes and branding, but that's also static, not responsive to prompts.

So if you want different images based on user choices, your best bet is to set up a layout calculation that uses text or colored blocks as a stand-in for images—or use a parameter-driven conditional block in the report layout. Full image swaps per parameter aren’t built-in, but with a little creativity, you can still signal a change visually when conditions change.

Yunita Damanik's profile image
Yunita Damanik

If you're looking to change a Cognos report’s background image based on a parameter, Cognos doesn’t support that dynamically. You can set a fixed background image using the APP_BACKGROUND parameter, which applies globally—not per user selection. Cognos does let you customize themes and branding, but that's also static, not responsive to prompts.

So if you want different images based on user choices, your best bet is to set up a layout calculation that uses text or colored blocks as a stand-in for images—or use a parameter-driven conditional block in the report layout. Full image swaps per parameter aren’t built-in, but with a little creativity, you can still signal a change visually when conditions change.

Marc Reed's profile image
Marc Reed IBM Champion

Are you talking about this option?

If so I don't believe so. By the way, anyone know what the option Default actually does?

If you want an image just somewhere on the page then you could use the Image object that can take a parameterized URL.

If there were less values (you mention 100s) you could use a conditional block with background images, but I don't think this is a suitable for this many values.

Ruben Seror's profile image
Ruben Seror

Thanks both for your answers.

Due to the high number of possible value for the parameter, using conditional block is not feasible.

As Marc suggestion, I'm trying to use image object to fit as background image.

Bob Smith's profile image
Bob Smith

Hi, I was wondering why background images for various objects appear not to allow the source to be based on a report expression.  I submitted an idea (CA-I-4650) to see if this could be incorporated into the product to provide more flexibility in sourcing images for background images instead of having to come up with creative techniques for something that seems to be available in other areas of the product.  Background Image | IBM Data Platform Ideas Portal for Customers