Crystal Reports: 3 New Uses For Sub Reports

I hate sub reports and always consider them the lastinformation you want into one or more arrays and
resort in any reporting solution.  The negative effectpass them through to the sub report to format and
on performance and maintainability is just not worthgroup as you want.
the easy ride they give the report writer.  Nine timesIt is possible to display the array in the main report and
out of ten reporting requirements can be met using aforgo the need for a sub report at all, but if you are
little forethought and planning (and a solid understandingreporting against a lot of data there is a chance the
of formulas).report will finish before the array has been fully
That said, there are a few novel ways of using subdisplayed.
reports which will not affect performance and actually3.  Conditional Data Targets
prove a boon to the developer.I come across this issue quite often: a report is needed
1.  Report Headerwhich always shows the same set of data, plus one
Any information, graphics, logos or special fields (Dateof two (or more) other sets of data depending on the
report was run etc) which will appear in every reportuser's choice or the results returned from the first set
can be built into a sub report which is then added toof data.
the main report. Because a single report can only have one set of
The performance hit is minimal, and a small amount islinked tables, multiple sub reports must be used. 
shaved off the development time, plus, it can go a longFor example: a sales report shows revenue for a
way to standardising your reports.  But the realparticular office, if the office has met its target the
benefit comes when the business decides to updatemanagers want to see how they compare to the rest
its logo or corporate color etc.  As long as the subof the other offices, but if they fail to meet their target
report is set to "Re-import When Opening" (via the subthey want to see the sales broken down by each rep
report's Format Editor), only one sub report needs toto identify any problem areas.
be changed to impact across the entire report library.A report based on sales reps and one based on
2.  Reconciling Conflicting Groupsnation office sales require completely different tables. 
Often there is a requirement to show the sameThe most efficient way to solve this problem is to
information summarised by logically conflicting groups. create a sub report for each.  Whichever is not
For example: showing the total sales for each weekneeded is suppressed and given Record Selection
within a month and totals sales per team in a month.criteria which will return an empty report.  The
A typical sub report can be used to load the datarequired sub report runs as normal.
again then group it by the second value, and this is theSummary
typical way to use a sub report.  But accessing theSub reports can kill a report's performance, but when
database again for data you have is a waste ofused with a little imagination they can be a helpful tool
resources which can be crippling with bigger reports.in expanding Crystal Reports functionality in a way that
The most efficient way to handle this is to load thecannot be realised by any other method.