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

Report functions in CR but fails in CE? 1

Status
Not open for further replies.

ITCPhil

Technical User
Jun 30, 2005
181
CA
Hi,

Using Crystal Enterprise 10 I am attempting to run a report containing multiple subreports (6) and a shared variable, which is the count of agents so we have a divisor for averages.

The report was done in Crystal Report 10 based around 33% on Oracle and 66% on Symposium data.

My issue is that although the report runs perfectly, in Crystal Report, it will fail when scheduled with Crystal Enterprise. The failure message comes back as :Error Message: Error in formula <Average returned to Queue due to timeout>. '{@Shared Name}; ' Division by zero. Details: errorKind. File D:\Program Files\Enterprise 10\Data\procSched\mnap141.reportjobserver\~tmp132c44b07d6af50.rpt.

I looked at the formula and '{@Shared Name};' should never be 0 because in my main report on the page header is a subreport counting the number of agents that logged in. The variable appears to be shared properly as it prints the number in the main report so the team leaders know how many agents logged in.

The one issue I can see is that the number of agents is a shared variable in a subreport passed to the main report. what happens after is that this main report passes this shared variable back to the other subreports. Is that something I am supposed to do or should I avoid it?

Any ideas why the report works in Crystal Report but not in Crystal Enterprise? I have been mailing it from CR but I would like go get it fixed.

Thank you,
Phil
 
Should never return zero, isn't the issue, the issue is that you should NEVER code to allow for this error.

Rewrite the formula so it does not, as in:

if <my potential zero divisor> <> 0 then
<formula>
else
0

Now it will never fail.

Shared variables are fine, I suspect that you'll need to do some discovery to determine why the datasource is retuniong zero in CE, perhaps it's connectivity is different, but the point is to always write good code, not to assumptions about data.

-k
 
Thank SV, I am kind of embarassed I didn't think of that considering I have used it frequently.

This is a report from my predecessor which I had to modify some. She had run into the same problem as per her comments and had fixed it by adding the shared variable formula on top of the formula using the shared variable??

It looked like :
{@Shared Name};
Shared numbervar agents;
Sum ({eAgentLoginStat.Duration})/agents;

Where Shared Name is what declared 'agents' in the first place.

I will change the formulas (I changed one and that worked but there are apparently multiple I will need to change.)

Thanks,
Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top