introduction to crystal reports - lsntap to crystal reports july 20, 2010 ... add summary of formula...
TRANSCRIPT
8262010
1
Introduction to Crystal Reports
July 20 2010
bullTom Bedall Pro Seniors Inc
8
Crystal Report Trainings
Intro to Crystal Reports ndash TODAY
Will be recorded and made available for FREE
Crystal Reports Basic Training Part I
Friday August 13th 11am Pacific 2pm Eastern
Crystal Reports Basic Training Part II
Friday August 20th 11am Pacific 2pm Eastern
8262010
2
9
Purchasing Crystal Reports
Free 30 day trial
httpwwwsapcomsolutionssapbusinessobje
ctssmefreetrialsindexepx
Crystal Reports - $55 for nonprofits
httpwwwtechsouporgstockcategoryaspc
atalog_name=TechSoupMainampcategory_name
=Business+Objects+SoftwareampPage=1ampCat1=
business+objectsampCatCount=1
10
Designing A Crystal Report
Choose the database amp tables to include
Choose the fields to display in the report
Record Selection
Select a subset of the database data for inclusion in the
report
Group the data
If you are designing a grouped report
8262010
3
11
Designing A Crystal Report
Sort Summarize and Suppress the data Add grand totals sub-totals percentages and suppress
immaterial data
Add additional information Running Totals Formulas amp Text Boxes
Add parameters End-user can choose what data to include
Format the report Add color lines boxes hyperlinks etc
12
Designing A Crystal Report
Choose the database amp tables to include
Start Page gt Blank Report gt Database Expert
Double Click Cases Table gt OK
Choose the fields to display in the report
View gt Field Explorer
Double Click Database Fields
Double Click Cases1
8262010
4
13
Designing A Crystal Report
Right Click Database Fields
Grouped order vs alphabetical order
Show Field Type
Click amp Drag Cases1 Fields Into Details Section
case_id
number
user_id
open_date
close_date
14
Designing A Crystal Report
Right Click Section Label
Expanding a section
Splitting a section
Inserting a sub-section
Deleting a sub-section
Suppressing sections
Fit section
Changing section order
8262010
5
15
Designing A Crystal Report
Refresh Report
Report gt Refresh Report Data (F5)
Note number of records in status bar
No filter means every database record included
Note zoom controls on status bar
16
Designing A Crystal Report
Record Selection
Report gt Select Expert gt Record
Limit data to Open Attorney Cases
Choose field Double click cases1close_date
Click Formula Editor button
Type IsNull(cases1close_date)
Save and close gt Ok gt Refresh Data
8262010
6
17
Designing A Crystal Report
The IsNull function ndash Boolean value
The Pika database supports null data values but
others may not
Some databases default all empty field values to
zero If so the IsNull function will not work if
the active database does not support null
values
Note Zero and blank (empty or ) are not
null values
18
Designing A Crystal Report
The IsNull function ndash Boolean value
Note This function must be used first in a formula for
it to be evaluated properly
In general when Crystal Reports encounters a null
valued field in a formula it immediately stops evaluating
the formula and produces no value
If you want to handle null field values in your formula
you must explicitly do so using one of the special
functions designed for handling them
IsNull PreviousIsNull or NextIsNull
8262010
7
19
Designing A Crystal Report
How many records now
Too many Includes non-attorney cases
Switch to Design tab
Drag cases1office into Detail section
Switch to Preview Tab
Note non-attorney cases in report
20
Designing A Crystal Report
Edit Record Selection Formula
Report gt Select Expert gt Record
Include only Attorney cases in report
Click New button gt double click cases1office
Choose Is Equal To from drop-down
Choose ATTY from drop-down
Click formula window at bottom of dialog box
Note formula Click Ok button Refresh data
8262010
8
21
Designing A Crystal Report
How Many Records Now
Now we have correct cases in report
Save report frequently
File gt Options gt Reporting Tab gt Auto Save
Reports After ____ Minutes
22
Designing A Crystal Report
Group the data by user_id
Report gt Group Expert gt double click
cases1user_id gt Ok
Click Design Tab
Note new sections
Group Header 1amp Group Footer 1
Note Group Tree in Preview Panel
8262010
9
23
Designing A Crystal Report
Insert Summaries
Right click cases1case_id field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Repeat above and also check Show as a
percentage of checkbox
24
Designing A Crystal Report
Suppress Detail Section
Right click Detail Section label gt Suppress (No
Drill-Down)
Add User Table to Report
Then can add user name fields to report
8262010
10
25
Designing A Crystal Report
Database gt Database Expert
Double-click users table
Note new tab Links
Note Automatic Smart-Linking links the
tables
Toggle on or off via File gt Options gt Database Tab
gt Last Checkbox Automatic Smart-Linking
26
Designing A Crystal Report
Linking Very important
Join direction From Table (on Left) to the To Table (on Right)
Inner Join Default (only include records with data from both tables) (records drop out when you add To table fields to the report)
Left Outer Join (includes all records in the From table whether or not that record has corresponding data in the To table)
8262010
11
27
Designing A Crystal Report
Linking Very important
Do Left Outer Join Same of records 161
Do Inner Join 160 records ndash drops the ldquono-
atty-assignedrdquo case Why No corresponding
record in the To table
Two aspects of report that limit Db records
Record Selection Criteria (intentional) and
Table Joins (unintentional)
28
Designing A Crystal Report
Adding Activity Records (Time) to the
report
Build report from the smallest common
denominator
Each case has multiple time records
Each attorney has multiple cases
Activity Table (link to) Cases Table (link to)
Users Table
8262010
12
29
Designing A Crystal Report
Add activities1act_date and
activities1hours to Details Section
Group all time records into a case
Report gt Group Expert gt double click
activities1act_date gt Ok
Save the report
30
Designing A Crystal Report
In Design Tab add the summary information to
Group Footer 2 that we want to show for
each case
Add Case Number and Open date to Group Footer
2
Add activities1act_date to Group Footer 2
Note that because activities1act_date is sorted
ascending activities1act_date in Group Footer 2 is
the latest activity date
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
2
9
Purchasing Crystal Reports
Free 30 day trial
httpwwwsapcomsolutionssapbusinessobje
ctssmefreetrialsindexepx
Crystal Reports - $55 for nonprofits
httpwwwtechsouporgstockcategoryaspc
atalog_name=TechSoupMainampcategory_name
=Business+Objects+SoftwareampPage=1ampCat1=
business+objectsampCatCount=1
10
Designing A Crystal Report
Choose the database amp tables to include
Choose the fields to display in the report
Record Selection
Select a subset of the database data for inclusion in the
report
Group the data
If you are designing a grouped report
8262010
3
11
Designing A Crystal Report
Sort Summarize and Suppress the data Add grand totals sub-totals percentages and suppress
immaterial data
Add additional information Running Totals Formulas amp Text Boxes
Add parameters End-user can choose what data to include
Format the report Add color lines boxes hyperlinks etc
12
Designing A Crystal Report
Choose the database amp tables to include
Start Page gt Blank Report gt Database Expert
Double Click Cases Table gt OK
Choose the fields to display in the report
View gt Field Explorer
Double Click Database Fields
Double Click Cases1
8262010
4
13
Designing A Crystal Report
Right Click Database Fields
Grouped order vs alphabetical order
Show Field Type
Click amp Drag Cases1 Fields Into Details Section
case_id
number
user_id
open_date
close_date
14
Designing A Crystal Report
Right Click Section Label
Expanding a section
Splitting a section
Inserting a sub-section
Deleting a sub-section
Suppressing sections
Fit section
Changing section order
8262010
5
15
Designing A Crystal Report
Refresh Report
Report gt Refresh Report Data (F5)
Note number of records in status bar
No filter means every database record included
Note zoom controls on status bar
16
Designing A Crystal Report
Record Selection
Report gt Select Expert gt Record
Limit data to Open Attorney Cases
Choose field Double click cases1close_date
Click Formula Editor button
Type IsNull(cases1close_date)
Save and close gt Ok gt Refresh Data
8262010
6
17
Designing A Crystal Report
The IsNull function ndash Boolean value
The Pika database supports null data values but
others may not
Some databases default all empty field values to
zero If so the IsNull function will not work if
the active database does not support null
values
Note Zero and blank (empty or ) are not
null values
18
Designing A Crystal Report
The IsNull function ndash Boolean value
Note This function must be used first in a formula for
it to be evaluated properly
In general when Crystal Reports encounters a null
valued field in a formula it immediately stops evaluating
the formula and produces no value
If you want to handle null field values in your formula
you must explicitly do so using one of the special
functions designed for handling them
IsNull PreviousIsNull or NextIsNull
8262010
7
19
Designing A Crystal Report
How many records now
Too many Includes non-attorney cases
Switch to Design tab
Drag cases1office into Detail section
Switch to Preview Tab
Note non-attorney cases in report
20
Designing A Crystal Report
Edit Record Selection Formula
Report gt Select Expert gt Record
Include only Attorney cases in report
Click New button gt double click cases1office
Choose Is Equal To from drop-down
Choose ATTY from drop-down
Click formula window at bottom of dialog box
Note formula Click Ok button Refresh data
8262010
8
21
Designing A Crystal Report
How Many Records Now
Now we have correct cases in report
Save report frequently
File gt Options gt Reporting Tab gt Auto Save
Reports After ____ Minutes
22
Designing A Crystal Report
Group the data by user_id
Report gt Group Expert gt double click
cases1user_id gt Ok
Click Design Tab
Note new sections
Group Header 1amp Group Footer 1
Note Group Tree in Preview Panel
8262010
9
23
Designing A Crystal Report
Insert Summaries
Right click cases1case_id field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Repeat above and also check Show as a
percentage of checkbox
24
Designing A Crystal Report
Suppress Detail Section
Right click Detail Section label gt Suppress (No
Drill-Down)
Add User Table to Report
Then can add user name fields to report
8262010
10
25
Designing A Crystal Report
Database gt Database Expert
Double-click users table
Note new tab Links
Note Automatic Smart-Linking links the
tables
Toggle on or off via File gt Options gt Database Tab
gt Last Checkbox Automatic Smart-Linking
26
Designing A Crystal Report
Linking Very important
Join direction From Table (on Left) to the To Table (on Right)
Inner Join Default (only include records with data from both tables) (records drop out when you add To table fields to the report)
Left Outer Join (includes all records in the From table whether or not that record has corresponding data in the To table)
8262010
11
27
Designing A Crystal Report
Linking Very important
Do Left Outer Join Same of records 161
Do Inner Join 160 records ndash drops the ldquono-
atty-assignedrdquo case Why No corresponding
record in the To table
Two aspects of report that limit Db records
Record Selection Criteria (intentional) and
Table Joins (unintentional)
28
Designing A Crystal Report
Adding Activity Records (Time) to the
report
Build report from the smallest common
denominator
Each case has multiple time records
Each attorney has multiple cases
Activity Table (link to) Cases Table (link to)
Users Table
8262010
12
29
Designing A Crystal Report
Add activities1act_date and
activities1hours to Details Section
Group all time records into a case
Report gt Group Expert gt double click
activities1act_date gt Ok
Save the report
30
Designing A Crystal Report
In Design Tab add the summary information to
Group Footer 2 that we want to show for
each case
Add Case Number and Open date to Group Footer
2
Add activities1act_date to Group Footer 2
Note that because activities1act_date is sorted
ascending activities1act_date in Group Footer 2 is
the latest activity date
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
3
11
Designing A Crystal Report
Sort Summarize and Suppress the data Add grand totals sub-totals percentages and suppress
immaterial data
Add additional information Running Totals Formulas amp Text Boxes
Add parameters End-user can choose what data to include
Format the report Add color lines boxes hyperlinks etc
12
Designing A Crystal Report
Choose the database amp tables to include
Start Page gt Blank Report gt Database Expert
Double Click Cases Table gt OK
Choose the fields to display in the report
View gt Field Explorer
Double Click Database Fields
Double Click Cases1
8262010
4
13
Designing A Crystal Report
Right Click Database Fields
Grouped order vs alphabetical order
Show Field Type
Click amp Drag Cases1 Fields Into Details Section
case_id
number
user_id
open_date
close_date
14
Designing A Crystal Report
Right Click Section Label
Expanding a section
Splitting a section
Inserting a sub-section
Deleting a sub-section
Suppressing sections
Fit section
Changing section order
8262010
5
15
Designing A Crystal Report
Refresh Report
Report gt Refresh Report Data (F5)
Note number of records in status bar
No filter means every database record included
Note zoom controls on status bar
16
Designing A Crystal Report
Record Selection
Report gt Select Expert gt Record
Limit data to Open Attorney Cases
Choose field Double click cases1close_date
Click Formula Editor button
Type IsNull(cases1close_date)
Save and close gt Ok gt Refresh Data
8262010
6
17
Designing A Crystal Report
The IsNull function ndash Boolean value
The Pika database supports null data values but
others may not
Some databases default all empty field values to
zero If so the IsNull function will not work if
the active database does not support null
values
Note Zero and blank (empty or ) are not
null values
18
Designing A Crystal Report
The IsNull function ndash Boolean value
Note This function must be used first in a formula for
it to be evaluated properly
In general when Crystal Reports encounters a null
valued field in a formula it immediately stops evaluating
the formula and produces no value
If you want to handle null field values in your formula
you must explicitly do so using one of the special
functions designed for handling them
IsNull PreviousIsNull or NextIsNull
8262010
7
19
Designing A Crystal Report
How many records now
Too many Includes non-attorney cases
Switch to Design tab
Drag cases1office into Detail section
Switch to Preview Tab
Note non-attorney cases in report
20
Designing A Crystal Report
Edit Record Selection Formula
Report gt Select Expert gt Record
Include only Attorney cases in report
Click New button gt double click cases1office
Choose Is Equal To from drop-down
Choose ATTY from drop-down
Click formula window at bottom of dialog box
Note formula Click Ok button Refresh data
8262010
8
21
Designing A Crystal Report
How Many Records Now
Now we have correct cases in report
Save report frequently
File gt Options gt Reporting Tab gt Auto Save
Reports After ____ Minutes
22
Designing A Crystal Report
Group the data by user_id
Report gt Group Expert gt double click
cases1user_id gt Ok
Click Design Tab
Note new sections
Group Header 1amp Group Footer 1
Note Group Tree in Preview Panel
8262010
9
23
Designing A Crystal Report
Insert Summaries
Right click cases1case_id field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Repeat above and also check Show as a
percentage of checkbox
24
Designing A Crystal Report
Suppress Detail Section
Right click Detail Section label gt Suppress (No
Drill-Down)
Add User Table to Report
Then can add user name fields to report
8262010
10
25
Designing A Crystal Report
Database gt Database Expert
Double-click users table
Note new tab Links
Note Automatic Smart-Linking links the
tables
Toggle on or off via File gt Options gt Database Tab
gt Last Checkbox Automatic Smart-Linking
26
Designing A Crystal Report
Linking Very important
Join direction From Table (on Left) to the To Table (on Right)
Inner Join Default (only include records with data from both tables) (records drop out when you add To table fields to the report)
Left Outer Join (includes all records in the From table whether or not that record has corresponding data in the To table)
8262010
11
27
Designing A Crystal Report
Linking Very important
Do Left Outer Join Same of records 161
Do Inner Join 160 records ndash drops the ldquono-
atty-assignedrdquo case Why No corresponding
record in the To table
Two aspects of report that limit Db records
Record Selection Criteria (intentional) and
Table Joins (unintentional)
28
Designing A Crystal Report
Adding Activity Records (Time) to the
report
Build report from the smallest common
denominator
Each case has multiple time records
Each attorney has multiple cases
Activity Table (link to) Cases Table (link to)
Users Table
8262010
12
29
Designing A Crystal Report
Add activities1act_date and
activities1hours to Details Section
Group all time records into a case
Report gt Group Expert gt double click
activities1act_date gt Ok
Save the report
30
Designing A Crystal Report
In Design Tab add the summary information to
Group Footer 2 that we want to show for
each case
Add Case Number and Open date to Group Footer
2
Add activities1act_date to Group Footer 2
Note that because activities1act_date is sorted
ascending activities1act_date in Group Footer 2 is
the latest activity date
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
4
13
Designing A Crystal Report
Right Click Database Fields
Grouped order vs alphabetical order
Show Field Type
Click amp Drag Cases1 Fields Into Details Section
case_id
number
user_id
open_date
close_date
14
Designing A Crystal Report
Right Click Section Label
Expanding a section
Splitting a section
Inserting a sub-section
Deleting a sub-section
Suppressing sections
Fit section
Changing section order
8262010
5
15
Designing A Crystal Report
Refresh Report
Report gt Refresh Report Data (F5)
Note number of records in status bar
No filter means every database record included
Note zoom controls on status bar
16
Designing A Crystal Report
Record Selection
Report gt Select Expert gt Record
Limit data to Open Attorney Cases
Choose field Double click cases1close_date
Click Formula Editor button
Type IsNull(cases1close_date)
Save and close gt Ok gt Refresh Data
8262010
6
17
Designing A Crystal Report
The IsNull function ndash Boolean value
The Pika database supports null data values but
others may not
Some databases default all empty field values to
zero If so the IsNull function will not work if
the active database does not support null
values
Note Zero and blank (empty or ) are not
null values
18
Designing A Crystal Report
The IsNull function ndash Boolean value
Note This function must be used first in a formula for
it to be evaluated properly
In general when Crystal Reports encounters a null
valued field in a formula it immediately stops evaluating
the formula and produces no value
If you want to handle null field values in your formula
you must explicitly do so using one of the special
functions designed for handling them
IsNull PreviousIsNull or NextIsNull
8262010
7
19
Designing A Crystal Report
How many records now
Too many Includes non-attorney cases
Switch to Design tab
Drag cases1office into Detail section
Switch to Preview Tab
Note non-attorney cases in report
20
Designing A Crystal Report
Edit Record Selection Formula
Report gt Select Expert gt Record
Include only Attorney cases in report
Click New button gt double click cases1office
Choose Is Equal To from drop-down
Choose ATTY from drop-down
Click formula window at bottom of dialog box
Note formula Click Ok button Refresh data
8262010
8
21
Designing A Crystal Report
How Many Records Now
Now we have correct cases in report
Save report frequently
File gt Options gt Reporting Tab gt Auto Save
Reports After ____ Minutes
22
Designing A Crystal Report
Group the data by user_id
Report gt Group Expert gt double click
cases1user_id gt Ok
Click Design Tab
Note new sections
Group Header 1amp Group Footer 1
Note Group Tree in Preview Panel
8262010
9
23
Designing A Crystal Report
Insert Summaries
Right click cases1case_id field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Repeat above and also check Show as a
percentage of checkbox
24
Designing A Crystal Report
Suppress Detail Section
Right click Detail Section label gt Suppress (No
Drill-Down)
Add User Table to Report
Then can add user name fields to report
8262010
10
25
Designing A Crystal Report
Database gt Database Expert
Double-click users table
Note new tab Links
Note Automatic Smart-Linking links the
tables
Toggle on or off via File gt Options gt Database Tab
gt Last Checkbox Automatic Smart-Linking
26
Designing A Crystal Report
Linking Very important
Join direction From Table (on Left) to the To Table (on Right)
Inner Join Default (only include records with data from both tables) (records drop out when you add To table fields to the report)
Left Outer Join (includes all records in the From table whether or not that record has corresponding data in the To table)
8262010
11
27
Designing A Crystal Report
Linking Very important
Do Left Outer Join Same of records 161
Do Inner Join 160 records ndash drops the ldquono-
atty-assignedrdquo case Why No corresponding
record in the To table
Two aspects of report that limit Db records
Record Selection Criteria (intentional) and
Table Joins (unintentional)
28
Designing A Crystal Report
Adding Activity Records (Time) to the
report
Build report from the smallest common
denominator
Each case has multiple time records
Each attorney has multiple cases
Activity Table (link to) Cases Table (link to)
Users Table
8262010
12
29
Designing A Crystal Report
Add activities1act_date and
activities1hours to Details Section
Group all time records into a case
Report gt Group Expert gt double click
activities1act_date gt Ok
Save the report
30
Designing A Crystal Report
In Design Tab add the summary information to
Group Footer 2 that we want to show for
each case
Add Case Number and Open date to Group Footer
2
Add activities1act_date to Group Footer 2
Note that because activities1act_date is sorted
ascending activities1act_date in Group Footer 2 is
the latest activity date
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
5
15
Designing A Crystal Report
Refresh Report
Report gt Refresh Report Data (F5)
Note number of records in status bar
No filter means every database record included
Note zoom controls on status bar
16
Designing A Crystal Report
Record Selection
Report gt Select Expert gt Record
Limit data to Open Attorney Cases
Choose field Double click cases1close_date
Click Formula Editor button
Type IsNull(cases1close_date)
Save and close gt Ok gt Refresh Data
8262010
6
17
Designing A Crystal Report
The IsNull function ndash Boolean value
The Pika database supports null data values but
others may not
Some databases default all empty field values to
zero If so the IsNull function will not work if
the active database does not support null
values
Note Zero and blank (empty or ) are not
null values
18
Designing A Crystal Report
The IsNull function ndash Boolean value
Note This function must be used first in a formula for
it to be evaluated properly
In general when Crystal Reports encounters a null
valued field in a formula it immediately stops evaluating
the formula and produces no value
If you want to handle null field values in your formula
you must explicitly do so using one of the special
functions designed for handling them
IsNull PreviousIsNull or NextIsNull
8262010
7
19
Designing A Crystal Report
How many records now
Too many Includes non-attorney cases
Switch to Design tab
Drag cases1office into Detail section
Switch to Preview Tab
Note non-attorney cases in report
20
Designing A Crystal Report
Edit Record Selection Formula
Report gt Select Expert gt Record
Include only Attorney cases in report
Click New button gt double click cases1office
Choose Is Equal To from drop-down
Choose ATTY from drop-down
Click formula window at bottom of dialog box
Note formula Click Ok button Refresh data
8262010
8
21
Designing A Crystal Report
How Many Records Now
Now we have correct cases in report
Save report frequently
File gt Options gt Reporting Tab gt Auto Save
Reports After ____ Minutes
22
Designing A Crystal Report
Group the data by user_id
Report gt Group Expert gt double click
cases1user_id gt Ok
Click Design Tab
Note new sections
Group Header 1amp Group Footer 1
Note Group Tree in Preview Panel
8262010
9
23
Designing A Crystal Report
Insert Summaries
Right click cases1case_id field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Repeat above and also check Show as a
percentage of checkbox
24
Designing A Crystal Report
Suppress Detail Section
Right click Detail Section label gt Suppress (No
Drill-Down)
Add User Table to Report
Then can add user name fields to report
8262010
10
25
Designing A Crystal Report
Database gt Database Expert
Double-click users table
Note new tab Links
Note Automatic Smart-Linking links the
tables
Toggle on or off via File gt Options gt Database Tab
gt Last Checkbox Automatic Smart-Linking
26
Designing A Crystal Report
Linking Very important
Join direction From Table (on Left) to the To Table (on Right)
Inner Join Default (only include records with data from both tables) (records drop out when you add To table fields to the report)
Left Outer Join (includes all records in the From table whether or not that record has corresponding data in the To table)
8262010
11
27
Designing A Crystal Report
Linking Very important
Do Left Outer Join Same of records 161
Do Inner Join 160 records ndash drops the ldquono-
atty-assignedrdquo case Why No corresponding
record in the To table
Two aspects of report that limit Db records
Record Selection Criteria (intentional) and
Table Joins (unintentional)
28
Designing A Crystal Report
Adding Activity Records (Time) to the
report
Build report from the smallest common
denominator
Each case has multiple time records
Each attorney has multiple cases
Activity Table (link to) Cases Table (link to)
Users Table
8262010
12
29
Designing A Crystal Report
Add activities1act_date and
activities1hours to Details Section
Group all time records into a case
Report gt Group Expert gt double click
activities1act_date gt Ok
Save the report
30
Designing A Crystal Report
In Design Tab add the summary information to
Group Footer 2 that we want to show for
each case
Add Case Number and Open date to Group Footer
2
Add activities1act_date to Group Footer 2
Note that because activities1act_date is sorted
ascending activities1act_date in Group Footer 2 is
the latest activity date
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
6
17
Designing A Crystal Report
The IsNull function ndash Boolean value
The Pika database supports null data values but
others may not
Some databases default all empty field values to
zero If so the IsNull function will not work if
the active database does not support null
values
Note Zero and blank (empty or ) are not
null values
18
Designing A Crystal Report
The IsNull function ndash Boolean value
Note This function must be used first in a formula for
it to be evaluated properly
In general when Crystal Reports encounters a null
valued field in a formula it immediately stops evaluating
the formula and produces no value
If you want to handle null field values in your formula
you must explicitly do so using one of the special
functions designed for handling them
IsNull PreviousIsNull or NextIsNull
8262010
7
19
Designing A Crystal Report
How many records now
Too many Includes non-attorney cases
Switch to Design tab
Drag cases1office into Detail section
Switch to Preview Tab
Note non-attorney cases in report
20
Designing A Crystal Report
Edit Record Selection Formula
Report gt Select Expert gt Record
Include only Attorney cases in report
Click New button gt double click cases1office
Choose Is Equal To from drop-down
Choose ATTY from drop-down
Click formula window at bottom of dialog box
Note formula Click Ok button Refresh data
8262010
8
21
Designing A Crystal Report
How Many Records Now
Now we have correct cases in report
Save report frequently
File gt Options gt Reporting Tab gt Auto Save
Reports After ____ Minutes
22
Designing A Crystal Report
Group the data by user_id
Report gt Group Expert gt double click
cases1user_id gt Ok
Click Design Tab
Note new sections
Group Header 1amp Group Footer 1
Note Group Tree in Preview Panel
8262010
9
23
Designing A Crystal Report
Insert Summaries
Right click cases1case_id field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Repeat above and also check Show as a
percentage of checkbox
24
Designing A Crystal Report
Suppress Detail Section
Right click Detail Section label gt Suppress (No
Drill-Down)
Add User Table to Report
Then can add user name fields to report
8262010
10
25
Designing A Crystal Report
Database gt Database Expert
Double-click users table
Note new tab Links
Note Automatic Smart-Linking links the
tables
Toggle on or off via File gt Options gt Database Tab
gt Last Checkbox Automatic Smart-Linking
26
Designing A Crystal Report
Linking Very important
Join direction From Table (on Left) to the To Table (on Right)
Inner Join Default (only include records with data from both tables) (records drop out when you add To table fields to the report)
Left Outer Join (includes all records in the From table whether or not that record has corresponding data in the To table)
8262010
11
27
Designing A Crystal Report
Linking Very important
Do Left Outer Join Same of records 161
Do Inner Join 160 records ndash drops the ldquono-
atty-assignedrdquo case Why No corresponding
record in the To table
Two aspects of report that limit Db records
Record Selection Criteria (intentional) and
Table Joins (unintentional)
28
Designing A Crystal Report
Adding Activity Records (Time) to the
report
Build report from the smallest common
denominator
Each case has multiple time records
Each attorney has multiple cases
Activity Table (link to) Cases Table (link to)
Users Table
8262010
12
29
Designing A Crystal Report
Add activities1act_date and
activities1hours to Details Section
Group all time records into a case
Report gt Group Expert gt double click
activities1act_date gt Ok
Save the report
30
Designing A Crystal Report
In Design Tab add the summary information to
Group Footer 2 that we want to show for
each case
Add Case Number and Open date to Group Footer
2
Add activities1act_date to Group Footer 2
Note that because activities1act_date is sorted
ascending activities1act_date in Group Footer 2 is
the latest activity date
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
7
19
Designing A Crystal Report
How many records now
Too many Includes non-attorney cases
Switch to Design tab
Drag cases1office into Detail section
Switch to Preview Tab
Note non-attorney cases in report
20
Designing A Crystal Report
Edit Record Selection Formula
Report gt Select Expert gt Record
Include only Attorney cases in report
Click New button gt double click cases1office
Choose Is Equal To from drop-down
Choose ATTY from drop-down
Click formula window at bottom of dialog box
Note formula Click Ok button Refresh data
8262010
8
21
Designing A Crystal Report
How Many Records Now
Now we have correct cases in report
Save report frequently
File gt Options gt Reporting Tab gt Auto Save
Reports After ____ Minutes
22
Designing A Crystal Report
Group the data by user_id
Report gt Group Expert gt double click
cases1user_id gt Ok
Click Design Tab
Note new sections
Group Header 1amp Group Footer 1
Note Group Tree in Preview Panel
8262010
9
23
Designing A Crystal Report
Insert Summaries
Right click cases1case_id field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Repeat above and also check Show as a
percentage of checkbox
24
Designing A Crystal Report
Suppress Detail Section
Right click Detail Section label gt Suppress (No
Drill-Down)
Add User Table to Report
Then can add user name fields to report
8262010
10
25
Designing A Crystal Report
Database gt Database Expert
Double-click users table
Note new tab Links
Note Automatic Smart-Linking links the
tables
Toggle on or off via File gt Options gt Database Tab
gt Last Checkbox Automatic Smart-Linking
26
Designing A Crystal Report
Linking Very important
Join direction From Table (on Left) to the To Table (on Right)
Inner Join Default (only include records with data from both tables) (records drop out when you add To table fields to the report)
Left Outer Join (includes all records in the From table whether or not that record has corresponding data in the To table)
8262010
11
27
Designing A Crystal Report
Linking Very important
Do Left Outer Join Same of records 161
Do Inner Join 160 records ndash drops the ldquono-
atty-assignedrdquo case Why No corresponding
record in the To table
Two aspects of report that limit Db records
Record Selection Criteria (intentional) and
Table Joins (unintentional)
28
Designing A Crystal Report
Adding Activity Records (Time) to the
report
Build report from the smallest common
denominator
Each case has multiple time records
Each attorney has multiple cases
Activity Table (link to) Cases Table (link to)
Users Table
8262010
12
29
Designing A Crystal Report
Add activities1act_date and
activities1hours to Details Section
Group all time records into a case
Report gt Group Expert gt double click
activities1act_date gt Ok
Save the report
30
Designing A Crystal Report
In Design Tab add the summary information to
Group Footer 2 that we want to show for
each case
Add Case Number and Open date to Group Footer
2
Add activities1act_date to Group Footer 2
Note that because activities1act_date is sorted
ascending activities1act_date in Group Footer 2 is
the latest activity date
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
8
21
Designing A Crystal Report
How Many Records Now
Now we have correct cases in report
Save report frequently
File gt Options gt Reporting Tab gt Auto Save
Reports After ____ Minutes
22
Designing A Crystal Report
Group the data by user_id
Report gt Group Expert gt double click
cases1user_id gt Ok
Click Design Tab
Note new sections
Group Header 1amp Group Footer 1
Note Group Tree in Preview Panel
8262010
9
23
Designing A Crystal Report
Insert Summaries
Right click cases1case_id field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Repeat above and also check Show as a
percentage of checkbox
24
Designing A Crystal Report
Suppress Detail Section
Right click Detail Section label gt Suppress (No
Drill-Down)
Add User Table to Report
Then can add user name fields to report
8262010
10
25
Designing A Crystal Report
Database gt Database Expert
Double-click users table
Note new tab Links
Note Automatic Smart-Linking links the
tables
Toggle on or off via File gt Options gt Database Tab
gt Last Checkbox Automatic Smart-Linking
26
Designing A Crystal Report
Linking Very important
Join direction From Table (on Left) to the To Table (on Right)
Inner Join Default (only include records with data from both tables) (records drop out when you add To table fields to the report)
Left Outer Join (includes all records in the From table whether or not that record has corresponding data in the To table)
8262010
11
27
Designing A Crystal Report
Linking Very important
Do Left Outer Join Same of records 161
Do Inner Join 160 records ndash drops the ldquono-
atty-assignedrdquo case Why No corresponding
record in the To table
Two aspects of report that limit Db records
Record Selection Criteria (intentional) and
Table Joins (unintentional)
28
Designing A Crystal Report
Adding Activity Records (Time) to the
report
Build report from the smallest common
denominator
Each case has multiple time records
Each attorney has multiple cases
Activity Table (link to) Cases Table (link to)
Users Table
8262010
12
29
Designing A Crystal Report
Add activities1act_date and
activities1hours to Details Section
Group all time records into a case
Report gt Group Expert gt double click
activities1act_date gt Ok
Save the report
30
Designing A Crystal Report
In Design Tab add the summary information to
Group Footer 2 that we want to show for
each case
Add Case Number and Open date to Group Footer
2
Add activities1act_date to Group Footer 2
Note that because activities1act_date is sorted
ascending activities1act_date in Group Footer 2 is
the latest activity date
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
9
23
Designing A Crystal Report
Insert Summaries
Right click cases1case_id field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Repeat above and also check Show as a
percentage of checkbox
24
Designing A Crystal Report
Suppress Detail Section
Right click Detail Section label gt Suppress (No
Drill-Down)
Add User Table to Report
Then can add user name fields to report
8262010
10
25
Designing A Crystal Report
Database gt Database Expert
Double-click users table
Note new tab Links
Note Automatic Smart-Linking links the
tables
Toggle on or off via File gt Options gt Database Tab
gt Last Checkbox Automatic Smart-Linking
26
Designing A Crystal Report
Linking Very important
Join direction From Table (on Left) to the To Table (on Right)
Inner Join Default (only include records with data from both tables) (records drop out when you add To table fields to the report)
Left Outer Join (includes all records in the From table whether or not that record has corresponding data in the To table)
8262010
11
27
Designing A Crystal Report
Linking Very important
Do Left Outer Join Same of records 161
Do Inner Join 160 records ndash drops the ldquono-
atty-assignedrdquo case Why No corresponding
record in the To table
Two aspects of report that limit Db records
Record Selection Criteria (intentional) and
Table Joins (unintentional)
28
Designing A Crystal Report
Adding Activity Records (Time) to the
report
Build report from the smallest common
denominator
Each case has multiple time records
Each attorney has multiple cases
Activity Table (link to) Cases Table (link to)
Users Table
8262010
12
29
Designing A Crystal Report
Add activities1act_date and
activities1hours to Details Section
Group all time records into a case
Report gt Group Expert gt double click
activities1act_date gt Ok
Save the report
30
Designing A Crystal Report
In Design Tab add the summary information to
Group Footer 2 that we want to show for
each case
Add Case Number and Open date to Group Footer
2
Add activities1act_date to Group Footer 2
Note that because activities1act_date is sorted
ascending activities1act_date in Group Footer 2 is
the latest activity date
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
10
25
Designing A Crystal Report
Database gt Database Expert
Double-click users table
Note new tab Links
Note Automatic Smart-Linking links the
tables
Toggle on or off via File gt Options gt Database Tab
gt Last Checkbox Automatic Smart-Linking
26
Designing A Crystal Report
Linking Very important
Join direction From Table (on Left) to the To Table (on Right)
Inner Join Default (only include records with data from both tables) (records drop out when you add To table fields to the report)
Left Outer Join (includes all records in the From table whether or not that record has corresponding data in the To table)
8262010
11
27
Designing A Crystal Report
Linking Very important
Do Left Outer Join Same of records 161
Do Inner Join 160 records ndash drops the ldquono-
atty-assignedrdquo case Why No corresponding
record in the To table
Two aspects of report that limit Db records
Record Selection Criteria (intentional) and
Table Joins (unintentional)
28
Designing A Crystal Report
Adding Activity Records (Time) to the
report
Build report from the smallest common
denominator
Each case has multiple time records
Each attorney has multiple cases
Activity Table (link to) Cases Table (link to)
Users Table
8262010
12
29
Designing A Crystal Report
Add activities1act_date and
activities1hours to Details Section
Group all time records into a case
Report gt Group Expert gt double click
activities1act_date gt Ok
Save the report
30
Designing A Crystal Report
In Design Tab add the summary information to
Group Footer 2 that we want to show for
each case
Add Case Number and Open date to Group Footer
2
Add activities1act_date to Group Footer 2
Note that because activities1act_date is sorted
ascending activities1act_date in Group Footer 2 is
the latest activity date
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
11
27
Designing A Crystal Report
Linking Very important
Do Left Outer Join Same of records 161
Do Inner Join 160 records ndash drops the ldquono-
atty-assignedrdquo case Why No corresponding
record in the To table
Two aspects of report that limit Db records
Record Selection Criteria (intentional) and
Table Joins (unintentional)
28
Designing A Crystal Report
Adding Activity Records (Time) to the
report
Build report from the smallest common
denominator
Each case has multiple time records
Each attorney has multiple cases
Activity Table (link to) Cases Table (link to)
Users Table
8262010
12
29
Designing A Crystal Report
Add activities1act_date and
activities1hours to Details Section
Group all time records into a case
Report gt Group Expert gt double click
activities1act_date gt Ok
Save the report
30
Designing A Crystal Report
In Design Tab add the summary information to
Group Footer 2 that we want to show for
each case
Add Case Number and Open date to Group Footer
2
Add activities1act_date to Group Footer 2
Note that because activities1act_date is sorted
ascending activities1act_date in Group Footer 2 is
the latest activity date
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
12
29
Designing A Crystal Report
Add activities1act_date and
activities1hours to Details Section
Group all time records into a case
Report gt Group Expert gt double click
activities1act_date gt Ok
Save the report
30
Designing A Crystal Report
In Design Tab add the summary information to
Group Footer 2 that we want to show for
each case
Add Case Number and Open date to Group Footer
2
Add activities1act_date to Group Footer 2
Note that because activities1act_date is sorted
ascending activities1act_date in Group Footer 2 is
the latest activity date
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
13
31
Designing A Crystal Report
Add total case time to Group Footer 2
Insert Summary
Right click activities1hours field in Details
Section gt Insert gt Summary
Calculate this summary Sum
Summary Location Group 2 cases1case_id
- A
Click Ok
32
Designing A Crystal Report
Suppress Details Section
Right click Detail Section label gt Suppress
(No Drill-Down)
Suppress Group Header 2
Right click Group Header 2 Section label gt
Suppress (No Drill-Down)
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
14
33
Designing A Crystal Report
Add Legal Problem and Client First Name to Group Footer 2
Database gt Database Expert
Double-click Contacts Table and Menu Legal Problem Table
Click on Links tab
Join with Left Outer Join cases1problem to menu_problem_20081value
34
Designing A Crystal Report
Join with Inner Join cases1client_id to
contacts1contact_id
Ok out of Database Expert
Add contacts1first_name and
menu_problem_20081label to Group
Footer 2
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
15
35
Designing A Crystal Report
Part II
Review Tables Fields amp Record Selection
Started with a blank report
Connected to Pro Seniorsrsquo Pika database
Added the Cases table to the report
Added fields from the Cases table to the report
Created a Record Selection Formula to select only
open attorney cases using the Formula Editor
36
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Group Summarize amp Suppress
Grouped records by user_id
Inserted distinct count for all group levels
Inserted summary as a percentage of total
Suppressed the detail section
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
16
37
IsNull(cases1close_date) and
cases1office in [ATTY ATTYL]
Discussed use of the IsNull function
Review Adding amp Linking Tables
Added Users table
Discussed linking tables
From and To tables
Using Inner and Left Outer Joins
Designing A Crystal Report
Part II
38
Review Adding Other Tables
Added menu_problem_2008 table
Discuss menu tables
Add problem label to report
Added activities table
Add activity hours to detail section
Add summary of hours (sum total) to group footer
section
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
17
39
Review Add Formula to Report
Create If-Then-Else formula using
Aged0To30Days function
Discuss If-Then-Else expressions
Add formula to detail section
Add summary of formula to group footer section
Designing A Crystal Report
Part II
40
Review Add Parameter Field to Report
Create parameter field for attorney
Discuss parameter fields
Add parameter field to Record Selection Formula
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
18
41
Add Time period Aged61To90 to report Field Explorer gt Right Click Formula Fields gt New gt
Type Time 61 to 90 gt Ok
Type the following formula
IF activities1act_date = Aged61To90Days
THEN activities1hours ELSE 0
The IF expression is one of the most useful control structures It allows you to evaluate an expression if a condition is true and evaluate a different expression otherwise
Designing A Crystal Report
Part II
42
Note The correct Crystal syntax for IF
statements is IF ltconditiongt THEN lt
expression1gt ELSE lt expression2gt where
lt condition gt lt expression1gt and lt
expression2gt are all single expressions
If you have multiple conditions convert
them into a single expression by
surrounding them in parentheses
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
19
43
Save and Close Formula Editor
Click and drag Formula Time 61 to 90 into Detail Section of Report
Insert Summary of Time 61 to 90 (sum) into Group Footer 2
Create two more formulas by repeating the above for the functions Aged31To60Daysand Aged0To30Days add them to the report and insert summaries
Designing A Crystal Report
Part II
44
Suppress time period summaries when they
equal zero
Right Click Time in 0 to 30 formula summary in
Group Footer 2 gt Format Field gt Common
Tab gt Suppress checkbox conditional formula
button gt Type Sum (Aged 0 to 30
cases1case_id) = 0
Repeat for other two time period summaries
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
20
45
Change report to display only one attorney at a time
Add Attorney Parameter to Report
Field Explorer gt Right Click Parameter Fields gt New
Name Attorney
List of Values Dynamic
Click here to add item users1user_id
Description users1last_name
Parameters Click to create parameter
Designing A Crystal Report
Part II
46
Prompt Text Choose Attorney Name
Sort Order Ascending by description
Prompt With Description Only True
Click Ok
Drag and drop Attorney Parameter Field
into Report Header Section to view the
Parameter Value
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
21
47
Add Attorney Parameter to Record Selection Formula to only include cases of the Attorney selected via the Parameter
Report gt Select Expert gt Record gt Formula Editor button
Type (
cases1user_id = Attorney or
cases1cocounsel1 = Attorney or
cases1cocounsel2 = Attorney)
)
Designing A Crystal Report
Part II
48
Save and Close
Ok and Refresh Data
Note that report is listing all cases where the
Parameter Attorney is listed as either Primary
Counsel Co-Counsel1 or Co-Counsel2
However the cases are still grouped by Primary
Counsel so we need to change the grouping
formula to group by the field containing the
Parameter Attorney
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
22
49
Create a Grouping Formula
Field Explorer gt Right Click Formula Fields gt New gt
Type Grouping Formula gt Ok
Type the following formula
If IsNull(contacts1first_name) then Projects else
If cases1user_id = Attorney then Primary Counsel else
If cases1cocounsel1 = Attorney then Co-Counsel 1 else
If cases1cocounsel2 = Attorney then Co-Counsel 2
Click the Close and Save button
Designing A Crystal Report
Part II
50
Delete Group-by cases1user_id and add
Group-by Grouping Formula
Report gt Group Expert
Group by window remove cases1user_id field
Add Grouping Formula field gt Move Grouping
Formula field above cases1cases_id by using
blue arrow in top right corner gt Ok button
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
23
51
Note order of groups in report are
ascending Create specific grouping order
Report gt Group Expert gt double click
Grouping Formula in Group by window gt
change ldquoin ascending orderrdquo to ldquoin specified
orderrdquo gt Drop down Named Group and
choose specified group order gt Ok gt Ok
Designing A Crystal Report
Part II
52
Add Sub-Totals to groups
Right click cases1number field in report gt
Insert gt Summary
Calculate this summary Distinct Count
Summary Location Group Footer 1
cases1user_id - A
Click Ok
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
24
53
Add Hyperlink from Case Number Field to Pika Case Note Screen
Right Click Case Number Field in Report gt Format Field gt Hyperlink Tab gt Hyperlink Type Click ldquoA Website on the Internetrdquo gt Hyperlink Information Website Address Delete ldquohttprdquo gt Click Formula Editor Button
Type the following formula which produces a URL
httpspikaproseniorsorgproseniors307 +
casesphp + ToText (cases1case_id0)
Click the Close and Save button
Designing A Crystal Report
Part II
54
Click the Close and Save button
Font Tab
Style Bold
Color Blue
Effects Check Underline box
Ok button
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
25
55
Add Months Open to Group Footer 2
Field Explorer gt Right Click Formula Fields gt New gt
Type Months Open gt Ok
Type the following formula
(CurrentDate - cases1open_date) (36512)
Click the Close and Save button
Drag and drop the Months Open Formula field into
Group Footer 2
Designing A Crystal Report
Part II
56
Add Alternate Row Background Color
The easiest way to accomplish this is to
create a Running Total count of Group
Footer 2
The first GF2 is 1 the second is 2 etc
Then create a formula that makes the odd
Group Footers one color and the even Group
Footers another color
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
26
57
Add Running Total
Field Explorer gt Right Click Running Total Fields gt New gt
Running Total Name GF2 Running Total
Field to Summarize cases1case_id
Type of Summary Distinct Count
Ok
Drag and drop GF2 Running Total field into Group Footer 2
Designing A Crystal Report
Part II
58
Add Conditional GF2 Background Color using an even-odd formula
Right Click Group Footer 2 Label gt Section Expert gt Click Color Tab in right window gt Click Formula Editor button
Type
If Remainder (GF2 Running Total2) = 0
then Color (255 255 155) else NoColor
Click Save and Close button gt Ok
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
27
59
The Remainder Function has the following components (numerator denominator)
Crystal Reports performs the division internally determines the whole number quotient and the remainder and returns only the remainder
In our case the remainder is zero for an even number and 5 for an odd number
See internet for RGB (Red Green Blue) color chart
Designing A Crystal Report
Part II
60
Add No ndashTime Warning Box to Report
Field Explorer gt Right Click Formula Fields gt New gt
Formula Name Warning Box
Type the following
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id) +
Sum (Time 61 to 90 cases1case_id))
= 0 then No Time In 90 Days
else
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
28
61
If
(Sum (Aged 0 to 30 cases1case_id) +
Sum (Time 31 to 60 cases1case_id))
= 0 then No Time In 60 Days
else
IfSum (Aged 0 to 30 cases1case_id) = 0
then No Time In 30 Days
else
Save and close
Drag and drop Warning Box formula field into Group Footer 2
Designing A Crystal Report
Part II
62
Note that Formulas are Hierarchical ie
Crystal Reports stops when it encounters
a True statement so it is important to
make sure the order of the expressions
within the formula is correct ie if
expression 2 and 3 is a subset of
expression 1 then the correct order is
set subset sub-subset
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
29
63
Format Different Formula Background Colors for Different Warning Messages
Right Click Warning Box Formula Field in Report gt Format Field gt Boarder Tab gt Background gt Background Conditional Formula Button
Type the following
If Warning Formula = No Time In 90 Days then crRed else
If Warning Formula = No Time In 60 Days then crBlue else
If Warning Formula = No Time In 30 Days then crSilver else
crNoColor
Designing A Crystal Report
Part II
64
Save and Close
Font Tab
Style Bold
Color White
Boarder Tab
Left Right Top amp Bottom Single
Ok button
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
30
65
Add Report Title
Insert gt Text Object gt Click and drag Cursor cross across Report Header Section to create a text box
Double click inside text box gt Type Open Case Data of
Field Explorer gt Double Click Special Fields gt Drag and drop Data Date field into text box in Report Header and drop following text
Designing A Crystal Report
Part II
66
Double click Text box to get to text and click Data Date field to highlight it then right click Data Date field gt Format Data Date gt Choose ldquoMonday March 1 1999rdquo gt Ok
Click text box and using small blue square handles click and drag text box so that it stretches from left to right report margins and is about 5 inches in height
Click on text box and use buttons on formatting menu bar to increase font to 28 point type and center the text
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
31
67
Add Attorney Name to Report Title
Right click Report Header Section label gt Insert Section Below
Repeat text box creation above but leave text box content empty
Field Explorer gt Database Fields gt users1 table gt Drag and drop first_name and last_name fields into text box in Report Header and separate them by a space
Designing A Crystal Report
Part II
68
Format Group Name Fields
Right click Group 1 Name field in Group
Header 1 Section gt Format Field gt Border
Tab gt Check Background checkbox gt Choose
Silver from the drop-down gt Paragraph Tab gt
Indentations First Line 01 gt Ok
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
32
69
Add Column Titles
Add small text box to Page Header Section
Add text and format background color font color
Copy text box by right clicking text box gt copy gt right click Page Header Section Paste gt change background color gt change text
Repeat above for other Column Titles
Designing A Crystal Report
Part II
70
A Running Total Report
Running totals are a flexible and powerful way to create specialized summaries and continually incrementing totals
Running total fields are similar to summary fields but allow more control over how the total is calculated and when it is reset
Running total fields allow you to total a value conditionally
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
33
71
A Running Total Report
For example you could use a running total to count
how many unduplicated clients were Male or how
many had income between 100 and 150 of the
poverty level
A Running Total in the Report Footer is independent
of the Detail Section of the report
Therefore once you formulate your Record Selection
Criteria you can begin to create your Running Total
fields
Designing A Crystal Report
Part II
72
Creating Running Totals
Every month we send last monthrsquos Title III-B demographic data to our funder
So we will create a report that when opened and refreshed automatically reports last monthrsquos client demographic data
One the report is designed and saved the data is available on demand to anyone who needs it
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
34
73
Creating The Title III-B Report
This report will contain fields from the cases contacts
and activities tables
Add these tables to the report and link them using
Inner Joins because all our Title III-B cases will have
clients and activities
Activities1Case_id gt To gt Cases1Case_id
Cases1Client_id gt To gt Contacts1Contact_id
Designing A Crystal Report
Part II
74
The Record Selection Formula will report
records that are tagged as Title III-B cases
casesfunding = 1 and
That had some case activity last month
activities1act_date in LastFullMonth
Note that a record is the lowest common
denominator which in this case is a time record
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
35
75
The first data we need to report is how many unduplicated clients were served last month
We will create a Running Total (RT) to calculate that number
Field Explorer gt Right Click RT Fields gt New gt Type Client Total
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Ok
Drag amp drop Client Total RT in Report Footer Section
Preview report
Designing A Crystal Report
Part II
76
The next RT will calculate new Title III-B clients for last month
Field Explorer gt Right Click RT Fields gt New gt Type New Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
36
77
The next RT will calculate new Title III-B clients for last month who were African-American
Field Explorer gt Right Click RT Fields gt New gt Type New African-American Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = 1
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
78
The next RT will calculate new Title III-B clients for last month who were Caucasian
Field Explorer gt Right Click RT Fields gt New gt Type New Caucasian Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and contactsethnicity = ldquo3
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
37
79
Repeat above for all ethnicities
Insert an ethnicity grand total formula
Field Explorer gt Right Click Formula Fields gt New gt Type Ethnicity Grand Total
Add all Ethnicity RTs to create Grand Total
New African-American Clients + New Caucasian Clients + [etc]
Click Save and Close button
Drag amp drop Formula in Report Footer Section below prior one
Preview report
Designing A Crystal Report
Part II
80
The next RT will calculate new Title III-B clients for last month who were Rural Rural is defined by County or Zip Code
Field Explorer gt Right Click RT Fields gt New gt Type New Rural Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
(contacts1county = Clinton or
contacts1zip in [45050 45044 45042 45013 45033 45003 45056
45013 45064 45327 45052 45002 45001 45030 45102 45103 45106
45107 45112 45118 45120 45121 45122 45130 45145 45147 45153
45156 45157 45158 45160 45162 45176 45244 45255 45032 45034
45039 45054 45065 45066 45068 45113 45152 45162 45241 45249
45327 45342 45458])
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
38
81
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
82
The next RT will calculate new Title III-B clients for last month who were age 75 or older
Field Explorer gt Right Click RT Fields gt New gt Type New Age 75+ Clients
Field to Summarize contacts1contact_id
Type of Summary Distinct Count
Evaluate Use a Formula Click Formula Editor button
cases1open_date in LastFullMonth and
Calculates the integer value of years between birth date and case open date
Int ((DateDiff (d contacts1birth_date cases1open_date))36525) gt= 75
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
39
83
Click Save and Close button
Ok
Drag amp drop RT in Report Footer Section below
prior one
Preview report
Designing A Crystal Report
Part II
84
Adding to the report title a Formula to auto
calculate the correct month and year for last
month
Field Explorer gt Right Click Formula Fields gt New gt
Type Last Month Title
This formula calculates the last day of the prior month by
subtracting one day from the first day of the current month
DateSerial (Year(CurrentDate) Month(CurrentDate) 01) - 1
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
40
85
Click Save and Close button
Ok
Drag amp drop Formula in Report Header Section
below other title
Preview report
Right click formula field in Report Header gt Format
Field gt Style March 1999
Designing A Crystal Report
Part II
86
Formatting report
Add new sections to Report Footer
Right Click Report Footer Section gt Insert Section
Below
Repeat until there is a sub-section for each client
demographic
Drag and drop each demographic into a separate sub-
section
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II
8262010
41
87
Format one sub-section and copy and paste into other sub-sections
Draw lines to create box to house the data
Insert gt Line gt Click and drag cursor to create line
Add Text objects to identify data
When complete Right Click Report Footer sub-section label gt Select All Section Objects gt Right Click Selected Objects gt Copy gt Right Click Next sub-section gt Paste gt Right Click Report Footer sub-section label gt Select All Section Objects gt Click Selected Objects and move as necessary
Designing A Crystal Report
Part II