Dynamic Report Image Based on Page Number

I am struggling to get the image to change based on what page the report is. Looking for any suggestions/workarounds.

I have a query data source “SOS_IMG” that returns an img column from a MS SQL Server table as VARBINARY.

SELECT img FROM SOS_IMG WHERE sos_id = ? ORDER BY sos_page ASC

My KEY for the Image component is as follows:


Idea is to have a table on the report with 5ish records per page. Each page has a supporting image based on what page is referenced from the SQL query… hence “Page-1” above ^^. Each image record has an accompanying page number. Page - 1 to get the index reference correct. Not the prettiest way about it but its where I’m at right now.

Currently passing the “Page” built in key is working but only for the 1st page. I don’t think it requests the image again for the 2nd page.

I was trying to figure out how to get the image to render inside of a table in the report so I could try and pass it dynamically that way, but I have had 0 luck.

My next solution is going to be to create multiple pages and multiple data sets constrained to the number of records per page, but I feel this may also easily break if there is too much or too little information.

If you try to put the second image onto the first page, does it work as intended?

If you can put all 5 images on the page(s) you can then hide the ones that don’t belong on that page number by making the visible property dynamic on the image.

I think it doesn’t. If I bump up the index by adding or subtracting it is only responding to the numbers I enter not the actually Page value it seems. Not sure if this only the outcome when previewing the report vs actually generating it.

I will try this now if it doesn’t heap space error on me. Fingers crossed.

For some reason using this method is making no image appear now. Tested the same formulas on screen as well to make sure they return true as well. And no errors.

I have made 5 overlapping image components on the report with correct references for the key. In the visible properties I have below:

But no luck when previewing just shows blank…

Anyone have an idea as to why image wouldnt be showing using this method?

I’m not sure as it worked for me.
Are you still including the image in the query and displaying it from there?
That is the only thing I can think of.

Yea my data source, “SOS_IMG”, is just a SQL query returning a dataset with one column, “img”, being the img as VARBINARY data type from SQL. Looks as follows for each image component:

img shape 1 key: SOS_IMG[0].img
img shape 2 key: SOS_IMG[1].img
so on so forth for 3 more.

If I change the key back to static for the visible field and the box is checked it will show the image.

This is quite the roadblock on the project for me unfortunately. I’m also considering just saving the XML and seeing if finding a viewer for it will show the images because all of the byte data still shows on an export for each image.