| I hate sub reports and always consider them the last | | | | information you want into one or more arrays and |
| resort in any reporting solution. The negative effect | | | | pass them through to the sub report to format and |
| on performance and maintainability is just not worth | | | | group as you want. |
| the easy ride they give the report writer. Nine times | | | | It is possible to display the array in the main report and |
| out of ten reporting requirements can be met using a | | | | forgo the need for a sub report at all, but if you are |
| little forethought and planning (and a solid understanding | | | | reporting 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 sub | | | | displayed. |
| reports which will not affect performance and actually | | | | 3. Conditional Data Targets |
| prove a boon to the developer. | | | | I come across this issue quite often: a report is needed |
| 1. Report Header | | | | which always shows the same set of data, plus one |
| Any information, graphics, logos or special fields (Date | | | | of two (or more) other sets of data depending on the |
| report was run etc) which will appear in every report | | | | user's choice or the results returned from the first set |
| can be built into a sub report which is then added to | | | | of data. |
| the main report. | | | | Because a single report can only have one set of |
| The performance hit is minimal, and a small amount is | | | | linked tables, multiple sub reports must be used. |
| shaved off the development time, plus, it can go a long | | | | For example: a sales report shows revenue for a |
| way to standardising your reports. But the real | | | | particular office, if the office has met its target the |
| benefit comes when the business decides to update | | | | managers want to see how they compare to the rest |
| its logo or corporate color etc. As long as the sub | | | | of the other offices, but if they fail to meet their target |
| report is set to "Re-import When Opening" (via the sub | | | | they want to see the sales broken down by each rep |
| report's Format Editor), only one sub report needs to | | | | to 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 Groups | | | | nation office sales require completely different tables. |
| Often there is a requirement to show the same | | | | The 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 week | | | | needed 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 data | | | | required sub report runs as normal. |
| again then group it by the second value, and this is the | | | | Summary |
| typical way to use a sub report. But accessing the | | | | Sub reports can kill a report's performance, but when |
| database again for data you have is a waste of | | | | used 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 the | | | | cannot be realised by any other method. |