Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6255883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:26:50+00:00 2026-05-24T14:26:50+00:00

I would like to create a report that will display a variable amount of

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T14:26:51+00:00Added an answer on May 24, 2026 at 2:26 pm

    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.

    create table #photo
    (
        Path varchar(100)
    )
    go
    
    insert into #photo values ('Path1')
    insert into #photo values ('Path2')
    insert into #photo values ('Path3')
    insert into #photo values ('Path4')
    insert into #photo values ('Path5')
    insert into #photo values ('Path6')
    insert into #photo values ('Path7')
    insert into #photo values ('Path8')
    
    go
    
    WITH Ordered AS (
    SELECT ROW_NUMBER() OVER (ORDER BY Path)-1 AS RowNumber, Path
    FROM #photo)
    SELECT Ord1.Path as Col1Path, Ord2.Path as Col2Path, ord3.Path as Col3Path
    FROM Ordered Ord1
    left outer join
    Ordered Ord2
    on Ord1.RowNumber = Ord2.RowNumber - 1
    left outer join 
    Ordered Ord3
    on Ord3.RowNumber = Ord2.RowNumber + 1
    where Ord1.RowNumber % 3 = 0
    
    
    drop table #photo
    

    This is the report

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like create a web service in ASP.Net 2.0 that will supports JSON.
I would like create my own collection that has all the attributes of python
I would like to create a stored procedure in MySQL that took a list
I would like to create events for certain resources that are used across various
I'm trying to create a report that displays for each months of the year
Would like to create a strong password in C++. Any suggestions? I assume it
I would like to create a database backed interactive AJAX webapp which has a
I would like to create an SSL connection for generic TCP communication. I think
I would like to create a file format for my app like Quake, OO,
I would like to create an application wide keyboard shortcut for a Java Swing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.