I would like to create a report that will display a variable amount of images i.e. 2 or 3 or 4 and so on. I have a dataset that returns the path to each of these images,see example.
SELECT Path FROM Photos
returns:
‘C:\photos\photo1.jpg
‘C:\photos\photo2.jpg
‘C:\photos\photo3.jpg
‘C:\photos\photo4.jpg
another dataset could return:
‘C:\photos\photo7.jpg
‘C:\photos\photo8.jpg
‘C:\photos\photo9.jpg
What I want the report to look like:
For example 1 I want 3 pictures across the report and then another on on the second line
For example 2 I just want 3 pictures across the report.
I have tried using a table and tablix and can not get it to work. Any Ideas?
Get your paths from the database in three fields. Then put the fields in three columns of a table.
The idea for the query is to get the 1st, 4th, 7th… path in column1, the 2nd, 5th, 8th … path in column 2, and the 3rd, 6th, 9th… path in column 3.
Number the paths using How to select the nth row in a SQL database table?, and use a modulo 3 function with a self join to create three columns.