Download presentation
Presentation is loading. Please wait.
Published byPeter Hopping Modified over 9 years ago
1
Crystal Reports In Depth Session XII
2
Crystal Reports - In Depth Reports outside of halFILE Selecting an ODBC Datasource Selecting a second table and linking it to the primary table Grouping data records Using formulas Adding parameters fields Using record selection Sub-totals and grand totals Adding a sub-report Graphs The Crystal Web Component
3
The screens shown in this presentation use Crystal Reports version 8.0
4
Crystal Reports - In Depth Begin a new report Select a halFile database using a File Data Source Select tables in the database –primetable vs multi Selecting an ODBC DataSource
5
To start a new, blank report, click the As a Blank Report option on Crystal’s welcome screen
6
In Crystal’s Data Explorer, find the File Data Source to your database and add Primetable and Multi from the list of tables
7
Once you close the Data Explorer Window, the Visual Linking Expert is displayed to define the relationship between tables. Drag an arrow from Multi.PRSERV to Primetable.PRSERV.
8
Once you close the Visual Link Expert, The Field Explorer is shown to let you drag and drop fields onto the Crystal Desktop.
9
Crystal Reports - In Depth Primetable vs Multi Primetable Document Number other single-entry fields Multi Document Number Counter (“number”) other multi-entry fields In Field Explorer, halFILE’s Document Number is called “PRSERV”
10
Crystal Reports - In Depth Primetable vs Multi Primetable 00000001 Multi 00000001, 0, Jones 00000001, 1, Smith 00000001, 2, Brown The above shows the relationship between Primetable and Multi using PRSERV
11
Crystal Reports - In Depth halFILE table in parameters database How to determine table names Selecting a Table in a different database and linking it to the primary table
12
To add a halFILE table to the report, select the Database-Add Database to Report menu. For halFILE tables, you should find the HFWParams32.dsn file data source in the dsn folder under halFILE.
13
I added the DocTypes table to the report. In Visual Linking Expert, I then drag an arrow from the Document_Types field in Primetable to the Code field in DocTypes to establish the relationship.
14
Now in Field Explorer, I have the DocTypes to select fields for the report.
15
Crystal Reports - In Depth Primetable vs Multi Primetable Document Number Coded Field other single-entry fields halFILE Table Code Description The above shows the relationship between a coded field and a halFILE table. In the report I am building, I’ve established a relationship between the Document_Type field and the Code field in the DocTypes table of HFWParams.
16
Crystal Reports - In Depth Primetable vs Multi Primetable 00000001 Doc_Type: MTG halFILE DocTypes Table MTG Mortgage If the Document Type is MTG, the link to the DocTypes table lets you obtain the description “Mortgage” from the DocTypes.
17
I’ve dragged some fields from the Field Explorer into the Details Section of the report. Titles are automatically placed in the Page Header section.
18
If you right click on the field in the Details Section of the report, then select Properties, the Format Editor screen is displayed. Here, you can use the tabs to set the field format as needed. I am going to set the date field to print in a different format than the default.
19
Crystal Reports - In Depth Right click on field in detail section Suppress if duplicated is used for Primetable fields to prevent the field from printing on every line for the document Date formatting Can grow option defines if the field can take up more than one report line Field Properties
20
When I click the Refresh button, the report is previewed so I can see how it will look when printed.
21
Crystal Reports - In Depth Defines how report is sorted Adds sub-headers and sub-footers Multiple groups are allowed in a report Grouping Data Records
22
The Insert-Group menu selection is used to define how the records are groups together. When you insert a group, the report is automatically sorted by that group. For the sample report, we will group by Grantee first, and then File Number
23
Now that the Groups for Grantee and File Number have been added, the Crystal desktop includes Group Headers and Footers. If you hover the mouse over the Group Header #1, it shows that the Group field is Grantee in the lower left corner of the screen.
24
I placed the Grantee field into Group Header #1 section and the File Number field into the Group Header #2 section. Now, when I refresh the report, I see my Group Headers.
25
Crystal Reports - In Depth Totals Concatenating fields Parsing fields –Subdivision and Township-Range formulas are available from Tech Support Using “Formulas”
26
Crystal Reports - In Depth Summary, running totals, grand totals Averages Maximum Minimum Count Sub-Totals and Grand Totals
27
To add a running total of Mortgage Amount, right click on the Mortgage Amount field in the Details Section and select Insert-Running Total. This displays this screen where I’ve set it up to add the Mortgage Amount to the running total every time the File Number changes and to clear the running total when the Grantee changes. So, I get a total by Grantee.
28
The Running Total was placed into the Group Footer for Grantee. I increased the size of the font for the Grantee field in Group Header #1. I also selected the Insert-Line menu and dragged a line at the top of the Group Footer #1 to designate the total. Finally, I used the Insert-Text Object menu to add “Lender Total” to the left of the running total.
29
Now when I refresh the report, it is beginning to look pretty good!
30
To get a Grand Total, another Running Total is inserted. It is never reset. I drag this field to the Report Footer section.
31
And here is the refreshed report.
32
Crystal Reports - In Depth Prompting the user for a parameter Uses: –Dynamic report headers –Dynamic selection criteria Adding “Parameters Fields”
33
A Parameter field called SelectMonth is used to designate what month is selected for the report. Select Insert-Parameter Field, then in the Field Explorer, right click on Parameter Field and select New. I fill in the form above to create the field.
34
Now the SelectMonth field is in Field Explorer and can be placed on the report or used for selection criteria.
35
Crystal Reports - In Depth Selecting data for the report Changing the selection formula Using “Record Selection”
36
Use the Report-Edit Selection Formula-Record Selection menu to select certain records fromthe database. In the above example, I’ve selected only records for the selected month and year. The Record Selection Formula Editor helps you set up the record selection. You can double click fields or functions to include them in the formula.
37
When you refresh the report, it now needs to know what records to select. This screen lets you enter your parameter fields.
38
This formula is used for a nice header of month and year.
39
Since I indicated 09/2002 for the selected date of the report, the report now includes only records for September 2002. I’ve placed the ‘FormatSelectedMonth’ formula field in the header and formatted the Mortgage Amount field to include the currency symbol. I also suppressed the File Number Group by right clicking in the Group Header and Group footer areas and selecting ‘Hide (Drill-Down ok)’.
40
Crystal Reports - In Depth Designing a sub-report Placing the sub-report into the main report Changing the sub-report Inserting a Sub-Report
41
Sub-Reports –Save the report as a new name –Close the report and re-open it –Select the File-Insert Sub-report menu –Select an existing report and open the saved report as the sub-report –Modify the sub-report as needed If the sub-report is a summarized version of the report you are working on, the easiest way to build it is:
42
The main report was saved as Hug_Mortgae_Reportsub.rpt. The report was reopened and the sub-report was inserted into the Report header section. If you double click the sub-report, you can design the report as needed.
43
The sub-report was changed to hide the detail. Also the date and file number fields were removed. Finally, the Grantee was placed in the Group Footer #1 section.
44
Now the report includes a summary by lender in the report header.
45
Crystal Reports - In Depth Inserting a graph Selecting the type of graph Placing the graph on the report Graphs
46
To add a graph to your report, select Insert-Chart. The above form is used to design the chart.
47
The Data tab of the Chart Expert lets you select how the chart is built. I’ve specified chart sections of the Grantee field, showing the Mortgage Amount totals.
48
The chart is placed in the Report Footer.
49
Crystal Reports - In Depth Allows reports to be viewed in a browser Requirements –Requires Internet Information Server –Not included in Crystal Standard –First included in Crystal Pro 7.0 Report Viewer download if not already installed Refresh the report by clicking the lightning bolt Crystal Web Component
50
The End
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.