Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating time a Crystal 7 report takes to run

Status
Not open for further replies.

flowersr

MIS
Feb 11, 2004
43
US
Hi,

I have been unable to 'time' how long it takes a Crystal report to run. Hoping someone can tell me why this does not work or have a better idea.

First, I created a hidden formula in the Report Header called Time_Init which contains:

BeforeReadingRecords;
dateTimeVar dtStart := DateTime (CurrentDate, CurrentTime)

Next I created a hidden formula in the report Footer called Time_End which contains:

WhilePrintingRecords;
dateTimeVar dtEnd := DateTime (CurrentDate, CurrentTime)

Last, I created a formula in the Report Footer called Time_Elapsed which contains:

Whileprintingrecords;
EvaluateAfter ({@_TimeEnd});
dateTimeVar dtEnd - dateTimeVar dtStart

Even with maximum decimal places defined I get no results. The report I am testing on takes 2 - 3 minutes to run.

Thanks, Rich
 
Hi !

Maybe this will work for you:

In the formula in the ReportHeader just let it contain DataTime.

The formula @Time_End in the RF will contain just PrintTime.

Then create a Report Footer b where you put your formula @Time_Elapsed and let it contain the following.
DateDiff('s',DateTime(CurrentDate,{@Time_Init}),DateTime(CurrentDate,{@Time_End}))

It will give you the time in seconds.

If you don´t have the DateDiff function (came with ver. 8) you can download it from
/Goran
 
goranm,

I don't have the luxury of using add-ins. I guess I will have to wait until I am able to move up to 8.5

Thanks,
Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top