50
Crystal Reports In Depth Session XII

Crystal Reports

  • Upload
    dorcas

  • View
    50

  • Download
    0

Embed Size (px)

DESCRIPTION

Session XII. Crystal Reports. In Depth. 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 - PowerPoint PPT Presentation

Citation preview

Page 1: Crystal Reports

Crystal ReportsIn Depth

Session XII

Page 2: Crystal Reports

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

Page 3: Crystal Reports

The screens shown in this presentation use Crystal Reports version 8.0

Page 4: Crystal Reports

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

Page 5: Crystal Reports

To start a new, blank report, click the As a Blank Report option

on Crystal’s welcome screen

Page 6: Crystal Reports

In Crystal’s Data Explorer,find the File Data Sourceto your database and add

Primetable and Multi from thelist of tables

Page 7: Crystal Reports

Once you close the Data ExplorerWindow, the Visual Linking Expert

is displayed to define the relationshipbetween tables. Drag an arrow from

Multi.PRSERV to Primetable.PRSERV.

Page 8: Crystal Reports

Once you close the Visual Link Expert,The Field Explorer is shown to let you

drag and drop fields onto theCrystal Desktop.

Page 9: Crystal Reports

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”

Page 10: Crystal Reports

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

Page 11: Crystal Reports

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

Page 12: Crystal Reports

To add a halFILE table to thereport, select the

Database-Add Database to Reportmenu. For halFILE tables, you

should find the HFWParams32.dsnfile data source in the dsn folder

under halFILE.

Page 13: Crystal Reports

I added the DocTypes table to thereport. In Visual Linking Expert,I then drag an arrow from the

Document_Types field in Primetableto the Code field in DocTypesto establish the relationship.

Page 14: Crystal Reports

Now in Field Explorer, I have theDocTypes to select fields for

the report.

Page 15: Crystal Reports

Crystal Reports - In Depth

Primetable vs MultiPrimetable

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.

Page 16: Crystal Reports

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.

Page 17: Crystal Reports

I’ve dragged some fieldsfrom the Field Explorerinto the Details Sectionof the report. Titles areautomatically placed

in the Page Header section.

Page 18: Crystal Reports

If you right click on the field in theDetails Section of the report, then

select Properties, the Format Editorscreen is displayed.

Here, you can use the tabs to set thefield format as needed. I am going to setthe date field to print in a different format

than the default.

Page 19: Crystal Reports

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

Page 20: Crystal Reports

When I click the Refresh button, thereport is previewed so I can see how

it will look when printed.

Page 21: Crystal Reports

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

Page 22: Crystal Reports

The Insert-Group menu selectionis used to define how the records

are groups together. Whenyou insert a group, the report

is automatically sorted by that group.For the sample report, wewill group by Grantee first,

and then File Number

Page 23: Crystal Reports

Now that the Groups for Grantee and File Numberhave been added, the Crystal desktop includesGroup Headers and Footers. If you hover themouse over the Group Header #1, it shows

that the Group field is Grantee in the lower leftcorner of the screen.

Page 24: Crystal Reports

I placed the Grantee field into GroupHeader #1 section and the File Numberfield into the Group Header #2 section.Now, when I refresh the report, I see

my Group Headers.

Page 25: Crystal Reports

Crystal Reports - In Depth

• Totals

• Concatenating fields

• Parsing fields– Subdivision and Township-Range

formulas are available from Tech Support

Using “Formulas”

Page 26: Crystal Reports

Crystal Reports - In Depth

• Summary, running totals, grand totals

• Averages

• Maximum

• Minimum

• Count

Sub-Totals and Grand Totals

Page 27: Crystal Reports

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 Amountto 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.

Page 28: Crystal Reports

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 Objectmenu to add “Lender Total” to the left of the running total.

Page 29: Crystal Reports

Now when I refresh the report, it isbeginning to look pretty good!

Page 30: Crystal Reports

To get a Grand Total, another Running Total is inserted. It isnever reset. I drag this field to the Report Footer section.

Page 31: Crystal Reports

And here is the refreshed report.

Page 32: Crystal Reports

Crystal Reports - In Depth

• Prompting the user for a parameter

• Uses:– Dynamic report headers– Dynamic selection criteria

Adding “Parameters Fields”

Page 33: Crystal Reports

A Parameter field called SelectMonth is used to designate what monthis 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.

Page 34: Crystal Reports

Now the SelectMonth field is in Field Explorer andcan be placed on the report or used for

selection criteria.

Page 35: Crystal Reports

Crystal Reports - In Depth

• Selecting data for the report

• Changing the selection formula

Using “Record Selection”

Page 36: Crystal Reports

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 orfunctions to include them in the formula.

Page 37: Crystal Reports

When you refresh the report, it now needs to knowwhat records to select. This screen lets you enter

your parameter fields.

Page 38: Crystal Reports

This formula is used for a niceheader of month and year.

Page 39: Crystal Reports

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 includethe currency symbol. I also suppressed the File Number Groupby right clicking in the Group Header and Group footer areas

and selecting ‘Hide (Drill-Down ok)’.

Page 40: Crystal Reports

Crystal Reports - In Depth

• Designing a sub-report

• Placing the sub-report into the main report

• Changing the sub-report

Inserting a Sub-Report

Page 41: Crystal Reports

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:

Page 42: Crystal Reports

The main report was saved as Hug_Mortgae_Reportsub.rpt.The report was reopened and the sub-report was inserted intothe Report header section. If you double click the sub-report,

you can design the report as needed.

Page 43: Crystal Reports

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 GroupFooter #1 section.

Page 44: Crystal Reports

Now the report includes a summaryby lender in the report header.

Page 45: Crystal Reports

Crystal Reports - In Depth

• Inserting a graph

• Selecting the type of graph

• Placing the graph on the report

Graphs

Page 46: Crystal Reports

To add a graph to your report,select Insert-Chart. Theabove form is used to

design the chart.

Page 47: Crystal Reports

The Data tab of the Chart Expertlets you select how the chart is built.I’ve specified chart sections of the

Grantee field, showing theMortgage Amount totals.

Page 48: Crystal Reports

The chart is placed in theReport Footer.

Page 49: Crystal Reports

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

Page 50: Crystal Reports

The End