Setting Default Properties

By default, Crystal Reports .NET will have a number of properties preset. These include the font and formatting for fields in your report, the page size, margins and layout, and so forth.

For more control over the reports you create, you can actually change these default properties. One of the most common scenarios is that Crystal Reports .NET defaults the font to Times New Roman and sets a specific font size for different types of fields. Your standard report template may be in Arial, so you can either spend a considerable amount of time changing the font sizes for the different elements in every report you create, or you can set the defaults and be done with it once and for all; any reports you create from this point onwards will use these settings.

There are two sets of properties associated with Crystal Reports .NET. The first comprises the default settings, which are written to the local registry and exist for all reports created using that particular machine. (There is no easy way to port these settings between two machines unless you get up to some registry wizardry.) These options can be found by right-clicking in the Report Designer and selecting Designer ^ Default Settings. Through the default settings shown in Figure 2-21, you can control field formatting and fonts, database options, and a variety of miscellaneous options grouped together under the different categories.

The second type of properties is the report options, which are specific to the report you are working with. To access the report options, right-click in the Report Designer and select Report ^ Report Options. There are fewer options in this dialog, and they are applied only to the report you are working on. Like the default settings, there is not an easy way to share these attributes with other reports. You will find options here for controlling how date-time fields are represented, for using indexes, and for sorting, among others, as shown in Figure 2-22.

Figure 2-22

As for the page and layout attributes of your report, there are two menus that appear when you right-click your report and select the Designer option. Printer Setup and Page Setup control the orientation, paper size, margins, and so on, and they default to the settings of your default printer.

If you are working on a development machine that does not have a printer driver installed or a default printer, you may want to install one (even if you don't have a printer attached or even available) to alleviate possible problems with your report should you need to print in the future. If there is no default printer specified, there is a check box in the Printer Setup shown in Figure 2-23 (located at the top of the dialog) that is marked No Printer.

It is best practice to develop your report with multiple printers in mind, with a margin appropriate to the printer's unprintable area and no special features that would be specific to one particular printer (such as oversized paper or bleed to the edge). This will ensure that your report will print consistently on different types of printers.

Figure 2-23

Was this article helpful?

+1 -1

Responses

  • J
    Why crystal report take times new roman by default?
    6 years ago

Post a comment