Crystal Reports in the Real WorldStandardized Templates


Arguably the most powerful use of report templates is simply adding consistent headers and footers. As described previously, the job of placing header and footer information in exactly the right place time after time is time-consuming and boring. A very simple template can give you a head start on basic formatting.

To create your template, an image of the company logo will be used. For this example, the Business Objects logo (saved in JPG format) from the corporate Web site is used.

1.

Begin by creating a new report without a data source, as described earlier in the chapter. Your starting point should look like Figure 14.12.

Figure 14.12. A blank canvas for the report template.


2.

From the Insert menu, choose Insert, Picture. Browse for the logo (.jpg or .bmp) file and add it to the top left of the report header. In the top right, add a text object and label it Data as of: and right justify the text. Add the special field Data Date to the right of the text.

3.

Add the special field Report Title to the page header, center justify the text, widen the field so it reaches to both edges of the report, change the font to 14, and add some vertical height so the text fits properly.

4.

In the page footer, add the special field Page N of M, centered with the field stretched to both left and right edges of the canvas. The template is now ready to be applied to all reports, effectively standardizing fundamental elements of report look and feel.

Note

To maximize flexibility, ensure that objects (like the logo) used in the template make full use of the repository. Not only is it important to standardize the look and feel, it should also be easy to update.

Figure 14.13. A sample standardized template.


5.

Save the template as StandardTemplate.rpt.




Crystal Reports XI(c) Official Guide
Crystal Reports XI Official Guide
ISBN: 0672329174
EAN: 2147483647
Year: N/A
Pages: 365

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net