cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Multiple Copies of a Subreport

Former Member
0 Kudos

Hi all,

I have a report that has 4 sections in the report header. Each of those sections contain only a subreport. Each of the subreports is a one page form. All other sections of the report are suppressed.

The main report has parameters that are used to suppress the various report header sections so that only the desired forms are included in the report.

What I need to accomplish now is to be able to generate multiple copies of the various subreports. For instance, 1 copy of the subreport in report header a, 3 copies of the subreport in report header b, and suppress report headers c and d.

The first thing I would expect to do is to change my report parameters and replace the current boolean flags with an integer count for each of the subreports. Given that, does anyone have any suggestions on how I can get the various subreports to print the number of times specified by the parameters?

Thanks,

David

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Split section into many sections as required to achive max number of copies.

Insert same subreport into each section.

In section Expert suppress depending on number entered into your parameter for number of copies.

Ian

Former Member
0 Kudos

Ian,

Thank you for your respose. This is definately a workaround and since my limit on copies is fairly small this could work for me.

So is it a given then that there is nothing built into CR that would allow this functionality?

David

Former Member
0 Kudos

Not that I am aware of. This is the only way I have managed to duplicate SRs.

Would be happy to learn of an alternative if some one else knows

Ian

JWiseman
Active Contributor
0 Kudos

hey David & Ian,

there's a way to do this if you don't have any data on the main report. even if you do have data in your main report now, you can always move that into a separate subreport which prints on the report footer instead.

here's how to accomplish this...

steps:

1) in the main report, change the database connection to be off of a single table that has an integer field from 1 to N, incremented by 1...i.e. 1,2,3,4,5, etc.

2) make a new details section for each subreport

3) change the record selection so that the number of records returned will equal the total number of subreports that will be printed

4) here's where it'll get a bit tricky / annoying...you'll have to suppress details A when the recordnumber is greater than the number of times you want the first subreport to print...let's call this numeric parameter Sub1...so suppress details A when recordnumber > Sub1

5) details B will be printed based on a prompt called Sub2. you'll have to suppress details B when the record number is less than or equal to Sub1 and when the record number is greater than Sub2

does this make any sense?

cheers,

jamie

Former Member
0 Kudos

Hi Jamie,

I think I see where you are going with this. To set up for this I need to define a table in my database that has a single int column. There needs to be enough rows in the table to account for the total copies of all subreports. (i.e. if 3 copies of subreport a, 2 copies of subreport b, 6 copies of subreport c, and 0 copies of subreport d then the table needs to have at least 11 rows in it.) I could limit the number of rows returned by implementing a record selection formula that limits the value of the integer column to Sub1 + Sub2 + Sub3 + Sub4, or 11 in my example.

Getting creative with the section suppression formulas, you could also add a flag to collate. So you could print:

Sub a

Sub b

Sub c

Sub d

Sub a

Sub b

Sub c

Sub d

OR

Sub a

Sub a

Sub b

Sub b

Sub c

Sub c

Sub d

Sub d

Yes, very creative solution. Thank you.

David

Answers (0)