Professional Documents
Culture Documents
Crystal Reports Training1
Crystal Reports Training1
Version 3.0
Pre-requisites
Introduction
Objectives
To enable you to develop your own reporting solutions in Crystal Reports with confidence
Course Overview
1 2 3 4 Data Structure Simple Report Creation Crystal Report Functions Running Reports
Section Overview
What is a Database? How do we connect to the Database? Scala data file structure
Scala5.x Modules
Data Management
Database
Crystal Reports
DDFs Describe Database (Btrieve) ODBC Connects to Database table SYSOBJECTS
Read Only
Database
MMNNCCYY
Module
Unique Number
Financial Year
Company Code
11
12
Format of Fields
13
Database to Interpret field and file names ScaDBconv.exe Scala5eu.mdb in Scala root directory Table in SQL database SCA_TAB_COLUMNS
14
15
16
Break
Break
17
Section Review
What is a Database? How do we connect to the Database? Scala data file structure
18
Section Overview
Report Style SQL Data Files Scala Data Files Scala Data Fields Preview Report
20
Report Creation
Click
21
Report Style
Report A - Stock Listing Step 1 - Choose report style
Click
22
Data Source
Step 2 - Select Data Source
Click
23
Data Source
Step 3 - Choose Data Source
24
25
Click To Finish
Click Next
27
28
29
30
Field Tab
31
Preview Report
When all fields are selected choose FINISH
Click
32
Report Creation
33
Report Creation
You can return to the report expert at any time by using the function Recommend that the report is saved before returning to the expert
34
Break
Break
35
Section Review
- Report Style - SQL Data Source - Scala Data Tables - Scala Data Fields - Preview Report
36
Exercise
Exercise 1 Customer Listing
Crystal Reports
Section 3
Section Overview
Design & Preview Report Options Guidelines Refreshing Data Right Click Sections
39
40
41
Preview Tab
42
Report Options
43
Options
44
Options
45
Options
46
Guidelines
47
Refreshing Data
48
Refreshing Data
Preview Sample
49
Right Clicking
50
Undo / Redo
51
Sections
Left-hand side of design tab shows report sections
Report Sections
52
Sections
Right-hand clicking in the sections area brings up menu Format sections command gives further details of sections. Section can be hidden allowing drill down function or suppressed
53
Sections
54
Section Review
Design & Preview Report Options Guidelines Refreshing Data Right Click Sections
55
Formatting
Section Overview
Adjusting Headings Increasing Field Width Adding new fields Adding Special fields Selection Expert Sorting Grouping Parameters
The New Standard in Quality Education
57
Adjusting Headings
Highlight field To rename double click or | edit | text object As with many windows products Crystal Reports supports drag and drop and copy and paste
58
Place pointer on blue boxes it changes to arrow Field width and height can be adjusted by dragging arrow
The New Standard in Quality Education
59
61
Database fields
Select field
62
63
A number of the special field values are set in Summary info from file menu
64
Selection Expert
65
Selection Expert
Selection Expert
New!
67
Sorting Records
68
Sort Expert
Sort Direction
69
Grouping
Used to group data together Similar to sorting but adds headers and footers
70
Grouping
71
Grouping
Define Order
72
Grouping
Select Groups
73
Grouping
Example of Grouping
74
Parameters
Used with selection terms Provides an easy way to change selection terms when a report is refreshed Parameter can be used as a field in the report. For Example in the report title. Compatible with compiled reports or web based reports
75
Parameters
76
Parameters
Text that appears when report is run
77
Allows parameter to hold single value or multiple values and Ranges. Experiment to see affect
The New Standard in Quality Education
Parameters
Warning on Usage
78
Parameters
Example of Usage
79
Parameters
80
Parameter
81
Section Review
Adjusting Headings Increasing Field Width Adding new fields Adding Special fields Selection Expert Sorting Grouping Parameters
The New Standard in Quality Education
82
Exercise
Exercise 2
Break
Break
84
Section Overview
86
Strings
Scala 5.1 SQL holds the majority of fields in the correct format. However due to historical reasons some fields will need to be converted Strings are collections of characters alpha and/or numeric Strings need to be converted to numbers for Crystal to perform operations
The New Standard in Quality Education
87
88
89
Fields
Operators
Formula Text
Functions
90
Function
ToNumber({Field name})
Be careful of Brackets
91
92
Unfortunately this formula does not always work. Scala leaves blanks in database instead of zeros. Therefore we need to add to the statement
If {field_name} = Then 0 Else ToNumber({Field_Name})
93
Exercise
Exercise 3
Sub total or grand total fields must be numeric. Highlight the field you require a total for and select totalling from insert drop down menu.
95
Right hand clicking on the report field will also bring up a shortcut method to enter totalling.
If the options are missing on the menu you have not chosen a numeric field
The New Standard in Quality Education
96
Sub-totalling
Entering a sub-total
97
Totalling
Insert grand-totals
Choice of sum, maximum, minimum, average etc. Field printed in report footer
The New Standard in Quality Education
98
Summaries
Similar to subtotal but will give same totalling options as grand total function
99
Converting Dates
Again the majority of dates in Scala database are held as datetime or date fields. However some may need conversion from a string field
19980915 YYYYMMDD
100
Converting Dates
If {Field_Name} = then Date(0,0,0) Else Date(ToNumber({field_name}[1 to 4]), ToNumber({field_name}[5 to 6]), ToNumber({field_name}[7 to 8]))
101
Section Review
102
Exercise
Exercise 4
Optional
Section Overview
Formatting Strings Formatting Numbers Formatting Dates Conditional Formatting Highlight Expert Top N Selection Report Alerts Running Totals SQL Expressions
The New Standard in Quality Education
105
Formatting Strings
Right-hand click on field or chose format field from format menu
106
Formatting Numbers
Extra Format Tab
107
Formatting Numbers
108
Formatting Dates
Extra Format Tab Choose Customize
109
Conditional Formatting
Conditional Vs Absolute
110
Conditional Formatting
111
Conditional Formatting
112
Conditional Formatting
Conditional formatting can be used throughout Crystal reports Advanced technique that is particularly useful in dealing with Sections
113
Highlight Expert
Works similarly to previous example of conditional formatting Gives a Traffic Light effect to the data
114
Highlight Expert
115
Report Alerts
Similar to Highlight expert but a window appears when a report is run to indicate records correspond to a certain set of conditions For Example when printing a customer statement shows customers with a balance exceeding 1000 New functionality in Crystal 8.5
116
Report Alerts
117
Report Alerts
118
Report Alerts
119
Report Alerts
When report data is refreshed the report will then produce an exception report
120
Top N Expert
Used for finding the top N on any column. For example the top 20 outstanding supplier balances on purchase ledger.
121
Top N Selection
You must create a sub total or summary before the top N selection will work.
Specify value of N
122
Running Totals
Used to create cumulative totals in reports Totals will be dependent on the grouping of the report
123
Running Total
124
Used only with SQL compatible databases Allow SQL syntax to entered in Crystal report Improves report performance when grouping, selecting or sorting data as query is run on server instead of workstation Limited in functionality compared with crystal formulas
The New Standard in Quality Education
125
126
127
Field Explorer
Browse Data Only New Edit Rename Insert Delete Toggle Field Type
128
Field Explorer
? denotes Parameter field @ denotes formula field denotes SUM or group field # denotes running total % denotes a SQL expression
129
Section Review
Formatting Strings Formatting Numbers Formatting Dates Conditional Formatting Highlight Expert Top N Selection Report Alerts Running Totals SQL Expressions
The New Standard in Quality Education
130
Exercise
Exercises 5
Linking Tables
Section 8
Section Overview
Why link tables Rules of linking What is an indexed field How to link tables
133
Scala holds data in multiple data files For the majority of reports data files need to be linked. Warning! Linking files will slow down report speed. Keep the number of data files to a minimum.
134
Rules Of Linking
Not all data files can be linked directly Data files must have common element Performance is improved if the common element is an indexed field
135
Rules of Linking
Linking must be done in a logical sequence It must flow through the report Jot down blueprint of report before starting to build it
136
Linking Tables
OR01
Order No
SC01
Stock Code Customer Code
OR03
SL01
137
A field that the data file uses as a sort or search key Example Telephone directory
23 North Parade, Horsham 01403 215998
Smith A J
138
Key 1
2307 2087 2498 2190
Key 2
Clive's Coffee Shop Arnot Limited Drew PLC Blackmore Electronics Customer Address Customer Address Customer Address Customer Address
Index 2
Arnot Limited Blackmore Electronics Clive's Coffee Shop Drew PLC Drew PLC
Key 1
2307 2087 2498 2190
Key 2
Clive's Coffee Shop Arnot Limited Drew PLC Blackmore Electronics Customer Address Customer Address Customer Address Customer Address
139
To an existing report
Select
140
Select
141
142
OK
143
Field name is same in both tables Field size is the same in both tables Field type is the same in both tables
Note: Because of this you may receive warnings when linking tables because of different data type Linking can only be done between database fields. (NOT FORMULAS)
The New Standard in Quality Education
144
145
Linking Tables
Crystal supports different join types One to One (equal) One to Many (Left Outer) Many to One (Right Outer) And others.
146
Linking Tables
Once the tables are linked click OK The fields in the table then become available to report on To return to the visual linking expert
147
Section Review
Why link tables Rules of linking What is an indexed field How to link tables
148
Exercise
Exercise 6
DAY 2 - Overview
Scala Database Structure Simple Report Creation Crystal Functionality Formatting More formatting and field types Linking Tables
150
Section Review
Pictures and Logos Hyperlinks Lines / Boxes Charting Mapping Function Report Style / Auto Arrange
152
Extra Functionality
Picture files can be embedded in report to give them a professional finish Crystal supports bitmap BMP, jpeg JPG, tiff and png files
153
Extra Functionality
In the properties of the picture or any field a hyperlink can be set so when clicking on the logo it takes you directly to the web site
154
Extra Functionality
155
These extra formatting tools are available from the insert menu
156
157
Charting
Tool can be used to create professional looking graphs and charts that can be embedded into the Crystal report Drill down functionality can be used in conjuncture with charts Charting works on subtotal values in the report however the whole report can be suppressed with just the chart being visible
The New Standard in Quality Education
158
Charting
159
Charting
160
Charting
161
Exercise
Exercise 7
Running Reports
Section 9
Section Overview
Exporting What is compilation and Distribution? Compiling Report Distribution Expert Web Reporting
171
Exporting
Crystal has links with other software including excel, adobe, HTML, RTF, text and XML To export report file | print | export or
172
Exporting
The report can also be emailed or saved to an exchange or lotus notes folder for publication
173
What is Compilation?
Reports can be saved as an executable Report users then need no knowledge of Crystal design tools they can just run the report Selection terms or parameters can be changed
174
Compiling
Historically Seagate software has included the compiling and distributing tool as part of the standard product In Version 8 & 8.5 this tool was replaced by web reporting however due to demand they included an update to the product which can be downloaded at http://www.crystaldecisions.com/
The New Standard in Quality Education
175
Compiling
176
Compiling
File name
No
Click OK to compile
The New Standard in Quality Education
177
Compiling
Users can run compiled reports only if they have crystal reports installed on their workstation
178
Compiling
179
Can be used where user does not have Crystal installed Copies program files that report needs to run. Users who run report will need to ODBC connection to the Scala Database set-up
180
181
This expert will then run the report in the background and prepare a list of dlls it needs to run the report. It warns about ODBC components but doesnt include them You can adjust the included dlls but this is not recommended Then click on build which produces a setup.exe file which then needs to be run on clients
The New Standard in Quality Education
182
Web Reporting
Crystal Version 8.5 requires crystal enterprise in order to run web reports If you purchased the Professional or Developer edition of Crystal Reports, then you also received the Crystal Enterprise Standard CD, along with five free concurrent access licenses of Crystal Enterprise Standard. More information is available on the fact sheet
The New Standard in Quality Education
183
Web Reporting
Scalas new product iScala Web reporter uses Crystal enterprise technology Crystal enterprise is not currently included in this course
184
Section Review
185
Exercise
Exercise 8
Database Features
Section 11
Section Overview
Crystal Report Functions Crystal Data Dictionaries Crystal SQL Designer SQL Views Scala SQL View Manager
188
SQL query produced automatically when building the report This query can be viewed and manually edited in Crystal reports
189
190
Verifying Database
If database is changed while user is connected in Crystal need to run function in order to update Crystal
191
SQL Views
Can only be written by a system manager of the SQL server Similar in design to Crystal SQL designer however far more powerful Are important for reporting in certain area of Scala as they cut down the number of sub-reports needed and cut down on complexity of report
202
SQL Views
Improve Crystal report performance as sorting and linking completed on the server Need access to SQL enterprise manager in order to build views
203
SQL Views
204
SQL Views
205
SQL Views
206
SQL Views
Changing data types for Columns Working with tables SY24 general code file and SL23 payment / delivery terms Working with General ledger transaction file GL06 which contains a binary field type for transaction type
207
Translates column numbers into meaningful names by the way of creating SQL views for each table
208
209
210
211
Views need to be created for each company Recreate views when a new financial year is created in Scala Recreate views when a service release is applied to Scala
212
Section Review
Crystal Report Functions Crystal Data Dictionaries Crystal SQL Designer SQL Views Scala SQL View Manager
213
Exercise
Exercise 9
Report Experts
Section 11
Optional
Section Overview
Standard Form Letter Form Cross-Tab Sub-Report Mail Label Drill Down OLAP
The New Standard in Quality Education
216
Report Experts
217
Report Experts
Drill down report created by hiding sections Mail Label Report Self Explanatory OLAP report (On-Line Analytical Processing).
Uses cubes of data to report on Cubes Create with SQL server Advanced Technique
218
Form Report
Form report asks for bitmaps for different sections of report. These bitmaps need to be created first outside Crystal An example of a report using Form expert is in Section 6 of the course binders Get Similar result inserting pictures into sections
The New Standard in Quality Education
219
Form Letter
Used for sending out letters with data from database Design the report as usual getting the basis or the report together with the Expert Example in Section 6 of Course Binders Form Letter creates one large text block per section
220
Form Letter
221
Form Letter
222
Cross Tab
Cross Tab combines the use or rows and columns along with a summarized field Expert creates the cross tab in report header section Example of Cross Tab in section 6 of the course binders
223
Cross Tab
224
Cross Tab
225
Cross Tab
226
Sub Report
Can be used to combine any two reports together Example In Section 6 of Course Binders A Sub report can be entered into an existing report using the function on the insert menu Sub Reports can be linked using a common element ( parameter field )
The New Standard in Quality Education
227
Sub Report
228
Sub Report
229
Sub Report
The sub report is inserted into a section on the main report and is run every time that section occurs The sub Report is an advanced technique but can provide good results. Data can be passed from the sub report to the main report by the use of variables
230
Section Review
Standard Form Letter Form Cross-Tab Sub-Report Mail Label Top N OLAP
The New Standard in Quality Education
231
Exercise
Exercise 10
Appendices
Appendix A
Section 14 Reporting on Accounting Strings
Accounting Strings
In Scala 5 accounts cost centres etc are not in separate fields they are held in one long field. Therefore to produce reports you may need to Separate this field into each dimension. Before you start you need to know the exact length of each dimension
The New Standard in Quality Education
235
Accounting Strings
To separate accounting string you will need to use formulas
236
Accounting Strings
237
Accounting Strings
If account code is longer than 6 just adjust the field values at end of formula Continue on like this for cost centre, product, project etc.
238
Accounting Strings
You may get problems with the previous formula if you are using alpha numeric cost centres, products or projects. As we have seen before these does not convert to a number If this is the case then use the next formula
The New Standard in Quality Education
239
Accounting Strings
240
Accounting Strings
241
Accounting Strings
The trim function does exactly what it says it trims a field down to the lengths controlled by the square brackets [].
242
Exercise
Exercise 11
Appendix B
Crystal Reports
Converting report from BTR to SQL Open up the crystal report and select convert database driver from the database drop down menu
245
Crystal Reports
246
Crystal Reports
Solution set location of data files in database drop down menu (remove the .dat at the end)
247
Crystal Report
248
Crystal Reports
Map the fields across to the SQL database The SQL database holds all field names as numbers e.g. SC01001 for stock code. Therefore use the scala5eu.mdb database to lookup the correct field codes for field names Alternatively create views from the SQL database using the SQL view manager and map your fields to theses
The New Standard in Quality Education
249
Crystal Reports
250
Crystal Reports
Once all data files are mapped across check the visual linking expert for the correct file linking Then run report. The report will probably give errors due to the different types of field type e.g. Numbers are formatted as numbers in SQL not as strings Then check report is returning the same information / totals
The New Standard in Quality Education
251
Btrieve
252
253
DAT
GL PL GL06ccyy.DAT cc = Company Code yy = Financial Year
The New Standard in Quality Education
254
255
Click
Click
The New Standard in Quality Education
256
Click
Solution
257
Set Location
258
Set Location
Set Location
259
Set Location
The setting of location only needs to be done once. Each subsequent time the report is ran Crystal will find the data.
260
DDF Builder
Scala 5.1 Btrieve does not come with the data dictionary files (DDF) these files need to be created using a program called Scala DDF Builder The Scala DDF Builder can create DDFs for companies, years and modules
261
Crystal Reports
262
Crystal Reports
263
Crystal Reports
264
Crystal Reports
265
Crystal Reports
266
Crystal Reports
267
Crystal Reports
268
Crystal Reports
269
Crystal Reports
270
Crystal Reports
271
Crystal Reports
272
Crystal Reports
273
Crystal Reports
274
Crystal Reports
275
Crystal Reports
276
Crystal Reports
If you install DDF builder to the Default location help can be found in
C:\program files\DDFstart\ddfbuilder.hlp
At year end you can add the next years DDF files to you current files This program saves a lot of time over smithware DDF builder although it is not as reliable
The New Standard in Quality Education
277