Michael6835
IS-IT--Management
Hello All:
I am fairly new to Crystal Reports (2008). My company just recently asked me to reproduce a P/L report from our "new" system so that it matched what we got from our "old" system.
The report criteria contained numerous one to many relationships that i had to sum on some lever by customer. I decided on using subreports and shared variables to do the trick.
The issue i have now is I need to perform calculations based on criteria in another columnn. I have included an example of the portion of the report i am currently struggling with.
We are a bus company and thus have different vehicle types. The reports groups all charters by customer and displays information such as "revenue", payroll", and other profit and cost columns which are based on formulas on the fields below.
Actual Miles and type are being passed from subreports. We have 2 vehicle types, "Full" and "mini" The "Other Direct" column is supposed to take the "actual miles" and multiply that times a "budgeted" number. In our case we're using examples of .80 for mini and 1.25 for full.
I have been able to accomplish this on the detail level of the main report by specifying an if statement in the other direct formula.
If {type} = "mini" Then @miles * .8 else @miles * 1.25.
I need to be able to some this "other direct" column to reflect this difference in calculations. Currently my report works if i only use one flat rate. I have tried creating 2 separate variables "mini" and "full" and using if statements in the subreport. Then tried to specify @OrderDirect2 (footer) to be "mini" + "full". But it never works out. When placing the two formulas on the group footer (and resets in the header) I am getting mixed results. For example, if I only have a customer with all "full" or all "minis" charters it works. If i come across a customer that contains mixed orders, then only one variable is set and the other is 0.
apologies for the long explanation, hoping the detail will reveal somethign simple i am missing.
Thanks
Mike
Group 1 Customer ABC
Charter ID "Actual Miles" Other Direct type(not actually displayed on report, but passed from "subreport" so if statement can be used)
1 500 $625 full
2 500 $400 Mini
Group 1 Footer 1000 $1025
I am fairly new to Crystal Reports (2008). My company just recently asked me to reproduce a P/L report from our "new" system so that it matched what we got from our "old" system.
The report criteria contained numerous one to many relationships that i had to sum on some lever by customer. I decided on using subreports and shared variables to do the trick.
The issue i have now is I need to perform calculations based on criteria in another columnn. I have included an example of the portion of the report i am currently struggling with.
We are a bus company and thus have different vehicle types. The reports groups all charters by customer and displays information such as "revenue", payroll", and other profit and cost columns which are based on formulas on the fields below.
Actual Miles and type are being passed from subreports. We have 2 vehicle types, "Full" and "mini" The "Other Direct" column is supposed to take the "actual miles" and multiply that times a "budgeted" number. In our case we're using examples of .80 for mini and 1.25 for full.
I have been able to accomplish this on the detail level of the main report by specifying an if statement in the other direct formula.
If {type} = "mini" Then @miles * .8 else @miles * 1.25.
I need to be able to some this "other direct" column to reflect this difference in calculations. Currently my report works if i only use one flat rate. I have tried creating 2 separate variables "mini" and "full" and using if statements in the subreport. Then tried to specify @OrderDirect2 (footer) to be "mini" + "full". But it never works out. When placing the two formulas on the group footer (and resets in the header) I am getting mixed results. For example, if I only have a customer with all "full" or all "minis" charters it works. If i come across a customer that contains mixed orders, then only one variable is set and the other is 0.
apologies for the long explanation, hoping the detail will reveal somethign simple i am missing.
Thanks
Mike
Group 1 Customer ABC
Charter ID "Actual Miles" Other Direct type(not actually displayed on report, but passed from "subreport" so if statement can be used)
1 500 $625 full
2 500 $400 Mini
Group 1 Footer 1000 $1025