cancel
Showing results for 
Search instead for 
Did you mean: 

How to repeat subreport dynamic amount of times?

Former Member
0 Kudos

Hello,

My question is whether or not there is a way to repeat a subreport within a main report.

Context:

I want to make a main report with a set number of subreports, let's say 10.

Of those 10 subreports I want to pass in a parameter to say that I want Sub1 to be in the report 1 time, so @numSub1 = 1, @numSub2 = 5, @numSub3 = 0, etc.

So in the main report I would have the first Subreport on the page 1 time, the second on the page 5 times, and hide the third subreport.

Constraints:

I am not able to do it by making 10 main reports, it has to be 10 subreports in 1 main report because the printer has to be sent only one job in order to staple the pages correctly. I also cannot have 10 main reports, export to PDF and merger the 10 PDFs into 1 PDF because another constraint is being able to do everything by the click of one button from the program I am passing the parameters from.

I will continue to do more research, and if I ever find and answer or come up with a solution I will post it. Otherwise, I really appreciate all responses. Even if it is a roundabout solution, I just need to be able to make this work.

Thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Tyler,

Subreports can't repeat on their own. You'd need to have the section it is placed on to be repeated as many times.

One way of doing this is to setup the Main Report so that it generates rows for "each" Subreport. The number of rows will depend on the number of times a particular subreport needs to be repeated.

-Abhilash