Getting started with report writing

The procedures and images in these topics reflect Crystal Reports XI Release 2. For more information on later versions, see the corresponding User Guide available on the Crystal Reports documentation site.

Optimizing Crystal Reports

Depending on your environment, reporting speeds can be slow. Turning off certain Crystal Reports options can help improve the speed.

  1. In Crystal Reports, go to File  Options.

  2. In the Options window, deselect options listed in this table.

    On this tab Deselect these options

    Database

    • Perform Query Asynchronously

    • Verify on First Refresh

    • Verify Stored Procedures on First Refresh

    • Automatic Smart Linking

    Reporting

    • Save Data With Report

    • Re-import Subreport on Open

  3. Click OK.

  4. Close Crystal Reports.

Creating a basic report

When creating a report, remember to save your work often.

  1. In Crystal Reports, click newbutton New.
    The Standard Report Creation Wizard opens.

  2. On the Data page, expand the Create New Connection folder.

  3. Select ODBC (RDO).
    The ODBC (RDO) window opens.

  4. On the Data Source Selection page, select your TM_Reporting alias and click Next.

    odbc

    If there are two or more aliases, and you are not sure which one to use, open a report in the Crystal Report Launcher and look at the ODBC value in the title bar.

    crlalias

  5. On the Connection Information page, log into the database using your user ID and password. Leave the Database field blank.

    connect

  6. Click Finish.
    The ODBC (RDO) window closes.

  7. On the Standard Report Creation Wizard’s Data page, highlight your schema owner and expand the tree. If you do not know your schema owner, contact your IT department.

  8. From the Available Data Sources area, drag to the Selected Tables area the table(s) that contain the fields you want in your report. In this illustration, the fields are in the TLORDER table.

    tables

  9. Click Next.
    The Fields page appears.

  10. From the Available Fields area, drag to the Fields to Display area the field(s) you want in your report. In this illustration, seven fields are included.

    fields

  11. Click Finish to see your report in Crystal Reports.

Formatting a report

When formatting a report, remember to save your work often. This illustration depicts a sample formatted report in Crystal Reports.

rptcomplete

Formatting individual fields

In the report, right-click on a field and select Format Field.

formatfield

The Format Editor opens. In this window, you can change various characteristics. For example, on the Font tab, you can change the field’s font, style, size, and color, among other things.

fmteditor

Formatting page layout

Go to File  Page Setup. In the Page Setup window, you can change the report orientation, margins, etc.

Resizing field columns

If you are unable to see all the characters in a particular field column, you can resize them.

  1. Click Design to switch to design mode.

    design

  2. Use your mouse to adjust the column widths.

    sizing

    Note: By default, Crystal Reports shows field names in design view. To show field lengths, go to File  Options and deselect Show Field Names.

Renaming field columns

To rename a column, double-click in the column header and change the text.

rename

Sorting data

If you look at your report in preview mode, you may notice that the data is not in logical order. To fix this:

  1. Go to Report  Record Sort Expert.
    The Record Sort Expert window opens.

  2. Using the addbutton Add button, add to the Sort Fields area the field(s) you want to sort on.

    recsort

    If you want, use the arrow buttons in the upper right of the Sort Fields area to change the field sort hierarchy.

  3. In the Sort Direction field, choose a sort direction.

  4. Click OK.

Adding a summary total to a field column

  1. Right-click the column to which you want to add a summary total.

  2. Go to Insert  Summary.
    The Insert Summary window opens.

  3. In the Calculate this summary field, select the type of summary you want.

  4. In the Summary location field, indicate where you want the summary to appear.

  5. Click OK.

In this illustration, selecting Count for the Bill Number field adds a summary to the last page of the report that contains the total number of freight bills in the report.

sumcount

Adding a report title

  1. Go to Insert  Text Object.

  2. Move the text object to the location where you want it to appear. Moving it to the page header section ensures that it appears on each page.

    title

  3. Format the title using the formatting tools provided.