Configuring Report Page and Margin Properties

With Crystal Reports, margins can either be set to use specific manually set margin definitions or can be selected to automatically adjust to the report margins. To set your report margins to meet exact specifications, follow these steps:

  1. From the File menu, click Page Setup, and the Page Setup dialog appears as shown in Figure 6.17.

    Figure 6.17. The Page Setup dialog is used to specify report margin settings.


  2. Modify the default page margins for your exact requirements.
  3. Click OK to save your changes.


Each of the margin settings is calculated from the paper edge. Consequently, a left margin of .25 inches causes the printing of the report page to start exactly one quarter of an inch in from the left edge of the paper.

As an alternative to specifying exact report margins, you can select the Adjust Automatically check box if you want Crystal Reports to adjust the report's margins automatically when the paper size changes. This option maintains the ratio of the margins to the printable area of the report by enlarging or reducing the left/right and top/bottom margins by the same factor. For example, this setting could ensure that a report designed for a printer that can only print within .5 inches of the paper's edge would maintain the same overall margin ratio when printed on a printer that could print to within .25 inches of the paper's edge.


If you decide to select the Use Default Margins options for your reports, there are two common issues to be aware of when printing reports (also described in the Crystal Reports Help files):

  • When printing a report in another environment in which the printer's default margins are greater than the report's setting, the report objects on the right side of the report print off the page.
  • When printing a report in another environment in which the printer's default margins are smaller (enabling a larger printing area), the entire report moves to the left side of the page.

As a result, it is recommended that you specify your own report margins. It is encouraged that you do not select the Use Default Margins option in the Page Setup dialog to avoid these common problems. It is advisable to set your report margins manually using the Page Setup dialog, even if the margins you want to specify are the same as the default margin settings. This issue becomes especially important when you distribute your reports over the Web and have no idea what type of printer the business user will be using.

Crystal Reports in the Real WorldReferencing External Resources

A very powerful use of hyperlinks is to be able to take advantage of the many resources on the Internet. Many Internet sites make use of what is called a QueryString. By knowing the URL and QueryString that drive a particular site, a report hyperlink can be customized to open a Web site and perform some functionality. In the next example, the address of the sample customers can be opened in by using a hyperlink:

  1. Start with opening the report Chap6PostFormat.rpt. From the Insert menu, choose Text Object. Add the text MapQuest to the report.
  2. Right-click the newly added text object and choose Format Tex. Then click the Hyperlink tab and click the x+2 button. See Figure 6.18 for an example of what the formula should look like. Enter the following code into the text:

    StringVar URL;
    // The prefix of the URL that will not change; it is hard-coded to the USA
    URL := "";
    URL := URL & "country=US&countryid=250&adtohistory=";
    // Add the street address
    URL := URL & "&address=" & {Customer.Address1};
    // Add the city
    URL := URL & "&city=" & {Customer.City};
    // Add the state
    URL := URL & "&state=" & {Customer.Region};
    // Add the ZIP code
    URL := URL & "&zipcode=" & {Customer.Postal Code};
    // Add the suffix of the URL
    URL := URL & "&submit=Get Map";

    Figure 6.18. Code that builds a dynamic data driven URL that will enable hyperlinks to the Mapquest Web site from a Crystal Report

  3. Click Save and Close to close the code window. Click OK to close the Format Editor window. Format the hyperlink using the same method used to format the e-mail address to show the user it is an actionable item.


The sample data does not necessarily use valid addresses. might open with only partial information, but the concept remains valid.

Part I. Crystal Reports Design

Creating and Designing Basic Reports

Selecting and Grouping Data

Filtering, Sorting, and Summarizing Data

Understanding and Implementing Formulas

Implementing Parameters for Dynamic Reporting

Part II. Formatting Crystal Reports

Fundamentals of Report Formatting

Working with Report Sections

Visualizing Your Data with Charts and Maps

Custom Formatting Techniques

Part III. Advanced Crystal Reports Design

Using Cross-Tabs for Summarized Reporting

Using Record Selections and Alerts for Interactive Reporting

Using Subreports and Multi-Pass Reporting

Using Formulas and Custom Functions

Designing Effective Report Templates

Additional Data Sources for Crystal Reports

Multidimensional Reporting Against OLAP Data with Crystal Reports

Part IV. Enterprise Report Design Analytic, Web-based, and Excel Report Design

Introduction to Crystal Repository

Crystal Reports Semantic Layer Business Views

Creating Crystal Analysis Reports

Advanced Crystal Analysis Report Design

Ad-Hoc Application and Excel Plug-in for Ad-Hoc and Analytic Reporting

Part V. Web Report Distribution Using Crystal Enterprise

Introduction to Crystal Enterprise

Using Crystal Enterprise with Web Desktop

Crystal Enterprise Architecture

Planning Considerations When Deploying Crystal Enterprise

Deploying Crystal Enterprise in a Complex Network Environment

Administering and Configuring Crystal Enterprise

Part VI. Customized Report Distribution Using Crystal Reports Components

Java Reporting Components

Crystal Reports .NET Components

COM Reporting Components

Part VII. Customized Report Distribution Using Crystal Enterprise Embedded Edition

Introduction to Crystal Enterprise Embedded Edition

Crystal Enterprise Viewing Reports

Crystal Enterprise Embedded Report Modification and Creation

Part VIII. Customized Report Distribution Using Crystal Enterprise Professional

Introduction to the Crystal Enterprise Professional Object Model

Creating Enterprise Reports Applications with Crystal Enterprise Part I

Creating Enterprise Reporting Applications with Crystal Enterprise Part II

Appendix A. Using Sql Queries In Crystal Reports

Creating Enterprise Reporting Applications with Crystal Enterprise Part II

Special Edition Using Crystal Reports 10
Special Edition Using Crystal Reports 10
ISBN: 0789731134
EAN: 2147483647
Year: 2003
Pages: 341 © 2008-2020.
If you may any questions please contact us: