?
Solved

Crystal Reports - storing values from first and last record

Posted on 2005-03-24
5
Medium Priority
?
426 Views
Last Modified: 2008-03-17
I have an application reads and prints fuel records from a ADO dataset (push method).  Each record contains an  odometer reading.  At the end of each group (vehicle unit), I need to be able to calculate the miles used buy subtracting the starting odometer reading from the ending odometer reading.

My problem is that I cannot figure out how to store the odometer reading from the first and last record of the group for this calculation.

I have considerd passing the miles traveled as a parm but I would have to pass in an amount for each unit ... and that could get real messy.

I also examined some of the totaling options and have tried but to no avail.

HELP!
0
Comment
Question by:robertjmackay
  • 3
  • 2
5 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 13622858
Use formulas and variables.

In the group header
Name - InitMiles
Formula
Global NumberVar StartMiles := {OdometerField};

In the group Footer
Name - CalcMiles
Formula
Global NumberVar StartMiles;

{OdometerField} - StartMiles

That should calculate the value you want.

mlmcc
0
 

Author Comment

by:robertjmackay
ID: 13623252
Didn;t work
InitMiles - placed in the group header contains the value of the first odometer reading
CalcMiles - placed in the group footer is 0.00

I assumed that the formula for CalcMiles contained 2 lines on the formula - 1st to define StartMiles and the 2nd do the subtract calculation

My formulas look like this

InitMiles
Global NumberVar StartMiles := {fuel.fuelodometer};

CalcMiles
Global NumberVar StartMiles;
{fuel.fuelodometer} - StartMiles
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 13627479
Add WhilePrintingRecords to the beginning of each formula


InitMiles
WhilePrintingRecords;
Global NumberVar StartMiles := {fuel.fuelodometer};

CalcMiles
WhilePrintingRecords;
Global NumberVar StartMiles;
{fuel.fuelodometer} - StartMiles

mlmcc
0
 

Author Comment

by:robertjmackay
ID: 13634538
thanks, that done the trick ... appreciate the quick response
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 13634636
Glad i could help

mlmcc
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question