|
|||||||||
|
Crystal Reports Tools: Improve Performance While Saving Time and Money |
|
Crystal Reports: Special Fields in Subreports |
||||||||||
|
Some report designers really like the special fields like Report Title, File Author and Report Comments. If your reports are published on Crystal Reports Server or Business Objects Enterprise, then these fields are displayed on the Web page where the report is listed and can provide useful information to users running your report. But what if your report has subreports? Inside the subreport you can also display these special fields. Our testing discovered that the only one of these that displays a value is "Report Title". You will also discover that when you are editing the subreport, the File menu item to edit any summary information (including Report Title) is disabled. You need to use "Format Subreport" if you want to change the Subreport Report Title. On the subreport tab you can change the "Subreport Name" and this will change what is displayed in the report title special field inside the subreport. Thanks to Mike on a recent training course for helping us work this one out. |
Click to enlarge |
||||||||||
|
Why is there so much interest in subreports? This concept is not new to Crystal Reports. It's been in practice for a long time, in fact. Subreports are common database tools that serve as intermediaries when you can’t create a report directly from multiple data sources. In Access, for example, doing anything across multiple queries or tables requires building a subreport. Crystal Reports doesn’t need the same degree of subreport "propping up" that Access does, but it still makes handy use of subreports. Suppose you have two databases, where each stores the same information—such as employee names, addresses, start dates, and so on. But, the one uses the date format YYYY-MM-DD and the other uses the date format MM-DD-YY. Hmm. Small problem, here. Suppose one table store numbers in a true number field and the other stores them as string variables or text. The only way to resolve such incompatibilities is with a subreport. You create one subreport to standardize the data in one database to the format of the data in the other. Or, if you’re feeling particularly masochistic, you create a subreport for each database, coming up with an entirely new format. Subreports can be linked (they update data as those data change in the source) or unlinked (they contain static data). You would want a linked report if you want "real time" information. You would want a static report under any of these conditions:
Among linked reports, a increasingly popular option is the on-demand subreport. It doesn’t process until you ask it to. It can appear as just a link or some other element (such as a graphic that says, "Update data now.") This has all kinds of benefits which will become apparent as you use it.
A note on linked subreportsLinked subreports are really useful. Link a field or formula from the main report and get the subreport to select records based on that field. But what if your subreport needs the linked parameter for something else? You might want to use it in a calculation, or for conditional grouping, sorting or section suppress. If you don’t use the link for record selection you may find that the link is removed when you exit the subreport link form. The solution is to create the parameter in the subreport prior to creating the link. When you create a link to an existing parameter in the subreport, it is saved when you exit the subreport link form.
|
|||||||||||
| This article is copyrighted by Crystalkeen, Mindconnection, and Chelsea Technologies Ltd. It may be freely copied and distributed as long as the original copyright is displayed and no modifications are made to this material. Extracts are permitted. The names Crystal Reports and Seagate Info are trademarks owned by Business Objects. | |||||||||||