Kheran
Kheran

Reputation: 552

How to use a report as subreport (with additional info) multiple times in a maintainable way?

So basically I have a report. I need this report to be printed as a 'set of reports'. Except that for each time the report is printed, there has to be a specific numbering at the bottom of the page. Where it would look something like this:
Page 1: Report + Page footer text 'Number 1'
Page 2: Conditions
Page 3: Report + Page footer text 'Number 2'
Page 4: Conditions
Page 5: Report + Page footer text 'Number 3'
Page 6: Conditions
And so on, for an undetermined amount of times..

In order to achieve this, I have created a main report, which currently contains 20 subreports, in order to achieve 20 pages (but I really I'd like this to be dynamical, maybe to be able to set the number of copies or something). Where each subreport consists of the single mentioned report (through the subreport 'Choose an existing report' option), with a custom text at the bottom.

The problem with this is that I can't maintain this. Every time an adjustment needs to be made to the original report, I will need to access 10 subreports and make the very same change or reload the report into this subreport.

What alternative ways of achieving my goal can you suggest, because this feels really 'dirty'. Thank you for reading.

I run Version 14.0.2.364 of Crystal Reports 2011

Upvotes: 1

Views: 733

Answers (1)

KuKeC
KuKeC

Reputation: 4620

To achieve this, you need to use group and detail section in main report. For making adjustments with paging, each section has his own

  • page before
  • page after
  • reset page

enter image description here

So to help you a bit, you need to have your data in one datasource, and group by Report/Conditions. For each group you can have only 1 subreport which will have link for that specific subreport (e.g. where barcod of smth is 1234) and there show your subreport data. For page number i would advise you to use my approach (for grouping) and then for page number you display group number (and that solves you all formulas for calculating pages).

If you are not familiar with grouping in Crystal, you can group your records in report by some fields by following image below

enter image description here

To summarize, try to define by which fields your reports has 20 subreports (probably some keys from database) and then group by that fields, examine advances of section expert and paging and you should be done in few hours making your report readable and easy to maintain.

Hope it helps

Upvotes: 1

Related Questions