Margins
As a general rule of thumb, it is best to keep the default
of 1" margins for top, bottom, left and right. In some cases you many need
to decrease the size of the margin for your entire report to fit on the page,
but be aware that this may cause issues on some printers. I have found
different printer manufactures handle margin sizes differently which has caused
me enough pain to try to keep margins to the default. Another tip about margins
- if you need to change the default margin size, change them on the report
file, not via code. The code below makes it very difficult to diagnose margin
issues on reports.
Listing 1 - Code for setting margins
PageMargins margins;
margins.topMargin = 8
margins.leftMargin = 7
rpt.PrintOptions.ApplyPageMargins(margins);
Templates
Using templates helps with one of the most important aspects
of delivering a design-rich reporting solution, which is being consistent.
Report templates are existing Crystal Report (.rpt) files which will allow you
to "inherit" many design related formatting settings, including:
·
Page headers and footers
·
Color formatting
·
Charting settings
·
Lines, Borders and Boxes
·
Logos and images
·
Addition of Standard Functions
·
Addition of Special Fields
·
Field highlighting
Templates can be created and applied to reports from the
"Template Expert" found on the report menu.
Dynamic Images
In the past it was difficult to change images based on some
sort of criteria, but Crystal XI gave us dynamic images which makes this task
trivial. If you are creating a "Product detail" report, adding an
image of the product can add the type of style you are looking for.
Figure 9: Dynamic Images
To add dynamic images to your report:
·
Add an image to your report.
·
Right click on the image and selected "Format Graphic."
·
On the "Picture Tab," Click the formula button (X+2
button).
Figure 10: Graphic location
·
Select a field or create a formula for your image path.
Figure 11: Graphic location formula