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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Division by zero error when viewing report through CrystalRDC

Status
Not open for further replies.

Cnnx

Technical User
Aug 19, 2003
16
GB
I wonder if anyone has come across this? I have a simple report in Crystal 8.5 which uses running totals and then uses these in a formula. The report counts clients in different categories at each office, the office being selected by means of a parameter.
The report runs fine in Crystal 8.5 on my local machine but when I publish it via the RDC it runs OK for 3 of the 4 office parameters but when run for the 4th gives the following error:
CRAXDRT Error Occurred on Server 2147191678 Division by zero.
The parameter which causes it to fail results in one of the running totals {#RTotalX} being zero so I used the following formula in case this was the problem;

If not IsNull({#RTotalX}) and {#RTotalX} <> 0 then
{#RTotalX}+{#RTotalY} else {#RTotalY}

However this did not fix the problem. Has anyone any ideas??
 
What is the formula that is doing the division by {#RTotalX}?

That formula need to be modified with an IF..THEN...ELSE

Example : IF {#RTotalX} = 0 THEN 0 ELSE ({WhateverFieldYouAreDividing})/{#RTotalX}
 
Thanks for this. There is only one formula which uses #RTotalX which is (#RTotalX + #RTotalY)and I have already applied the check for null or zero to this. This formula is never used as a denominator and so maybe the fact that #RTotalX is zero in the case where the report fails is pure coincidence.
The really odd thing is that the divide by zero error only occurs when the report is published via Crystal RDC - it runs fine on the local machine running Crystal 8.5. There must be a difference in the way it runs in the RDC which causes the error.
 
What are the rules for the running totals? When do they calculate and when do they reset?
 
The running totals were created using the Create Running Total Field dialog box.
They are evaluated using a formula e.g.
{@Activity}= &quot;N&quot; And {CR_CLIENTS.Date}<(CurrentDate-90)
and the reset option is set to 'never'. The report has no groups and the Running Totals perform a count on a field {Client_Ref} i.e. they count the number of people under each Activity with an added condition on the field {Date}. The detail section of the report is suppressed.
I have not specified when the running totals should calculate as I'm not sure how to do this, but presumably there is a default in 8.5? Could this be the problem?



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top