on 09-30-2014 8:22 PM
I am working on an employee position report that lists the minimum, maximum, and midpoint for each position. That date resides in a table where one field (step) indicates either Min, Mid or Max and then corresponds to the pay rate (rate). Looks like this (data isn't real):
Step | SalaryRate | HourlyRate |
---|---|---|
MIN | 20,000 | 20.00 |
MID | 30,000 | 30.00 |
MAX | 40,000 | 40.00 |
When I pull the fields into the Crystal report, of course it lists each one horizontally. However, I want it listed vertically. For example:
We want:
It shows:
Any thoughts?
Here's what I would do:
1. We're going to use some variables to collate this information. So the first thing you're going to do is group on Position.
2. Create a single formula to initialize the variables. It will look like this:
WhilePrintingRecords;
NumberVar MinSalary := 0;
NumberVar MinHour := 0;
NumberVar MidSalary := 0;
NumberVar MidHour := 0;
NumberVar MaxSalary := 0;
NumberVar MaxHour := 0;
Place this formula in the Position Group Header section.
3. Create a formula for each - Min, Mid, Max. They will look something like this:
WhilePrintingRecords;
NumberVar MinSalary;
NumberVar MinHour;
if {MyTable.Step} = "MIN" then
(
MinSalary := {MyTable.SalaryRate);
MinHour := {MyTable.HourlyRate);
);
""
Place these formulas in the details section. They won't display anything because of the final empty string.
3. Finally, create a final set of formulas - one for each of the variables. Something like this:
{@MinSalary}
WhilePrintingRecords;
NumberVar MinSalary
NOTE: Be sure to NOT include the semicolon at the end of the last line - if it's there the value won't appear on the report.
4. In the Position group footer, place the formulas from step 3 so that they display as in your example.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another way to do this is:
1) Insert a Group on the 'Position' field
2) Create a formula called (@MI_Sal) with this code:
if {MyTable.Step} = "MIN" then
{MyTable.SalaryRate)
3) Create another formula called (@MI_Hourly) with this code:
if {MyTable.Step} = "MIN" then
{MyTable.HourlyRate)
4) Go to Insert Summary > Choose the @MI_Sal formula as the 'Filed to Summarize' > Under 'Summary Location' choose 'Group Footer' > Under 'Summary Operation' choose 'Maximum'
5) You can then move the summary from the Group Footer to the Group Header if that's where you intend to display the data
6) Repeat Steps 2 through 4 for all the other fields
-Abhilash
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.