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

Displaying average on chart issue

Status
Not open for further replies.

Harki06

Technical User
May 18, 2006
85
US
I am using CR 10 and I am having a strange issue. I had this chart working since quite a few months and now all of a sudden with no change at all I am getting this error -

A print time formula that modifies variables is used in a chart/map i.e @AverageResolutionforType

The chart in questions displays in the Report header -
On change of year & change of type the AverageResolutionforType which is the following -
Sum ({@Resolution Days}, {@Type})/ Count ({MCTCase.Case_Number}, {@Type})

When I delete the chart, the report displays data else with the above it is giving error message and then a blank screen.
 
You need to show the contents of ALL nested formulas.

-LB
 
Type formula -

If {MCTCase.Case_Type}="ACC" then "Accommodation"
else if {MCTCase.Case_Type}= "ACOM" then "Businesslines"
else if {MCTCase.Case_Type}= "APR" then "Businesslines"
else if {MCTCase.Case_Type}= "PGR" Relations
else if {MCTCase.Case_Type}= "RAP" then "RAP"
else if {MCTCase.Case_Type}= "RAP1" then "RAP"
else if {MCTCase.Case_Type}= "RAP3" then "RAP"
else {MCTCase.Case_Type}


Resolution Days is the standard one used to avoid Saturdays and Sundays in calculating difference in dates -
// No. of days to resolve a case i.e case closure

DateVar FirstDay:= {MCTCase.Case_Open_Date} ;
DateVar LastDay:= {MCTCase.Case_Close_Date} ;

// FirstDay and LastDay should be substituted throughout the
// formula with your date fields.

Numbervar Days;
Numbervar Weekends;
Numbervar Finaldays;
DateVar StartDate;
DateVar EndDate;


If DayOfWeek(FirstDay) = 7 Then
StartDate := FirstDay - 1
Else If DayOfWeek(FirstDay) = 1 Then
StartDate := FirstDay - 2
Else StartDate:=FirstDay;

If DayOfWeek(LastDay) = 7 Then
EndDate := LastDay +2
Else If DayOfWeek(LastDay) = 1 Then
EndDate := LastDay + 1
Else EndDate := LastDay;

Days:= EndDate - StartDate;

WeekEnds := (Truncate(Days/7))*2;

If DayOfWeek(StartDate) > DayOfWeek(EndDate) Then
FinalDays:=Days-Weekends-2
Else FinalDays:=Days-Weekends;

If DayOfWeek(LastDay) = 7 Or DayOfWeek(LastDay) = 1 Then
FinalDays := FinalDays - 1
Else FinalDays := FinalDays;

FinalDays;

 
I don't see any reason for the error. Are these formulas shown exactly as you used them? You don't have "whileprintingrecords" added in your actual formulas, do you?

-LB
 
Sorry, I got caught up. No, I don't have Whileprintingrecords. Yes, these formulas are exactly as I used them and that concerns me since I did not make any change and it was working beautifully.

If it helps further the report is grouped by YearCloseDate, Type, Month and then you have details. I have placed this chart in the report header.

When I tried to narrow down to the error and tried to insert the chart again, this formula AverageResolutionforType does not display in the choice of fields. I can select the individual - Sum of Resolution and Count of Case Number and even draw a chart on those.
 
I'm sorry, but I cannot recreate your issue in CR XI. It seems to me that there has to be something in one of your formulas that forces a later evaluation time, such as whileprintingrecords or a shared variable. Otherwise, I would just try deleting the chart and trying again--but you've already tried that.

-LB
 
One thing weird. I told my colleague and he opened up the report and it runs perfectly. He even refreshed the data with no issues.

I uninstalled Crystal twice and deleted all registry entries but still I get the error. Do you think something is corrupted? Thanks for looking into it.
 
I wonder whether it has something to do with different settings (file->options or file->report options) on the two machines. Can the close date be null? If your colleague's machine was set to convert nulls to default and yours wasn't that might be the cause. Not sure--I can't really test this.

-LB
 
I am reinstalling Crystal. Let me see. Yes, the close date can be null sometimes...
 
Did not help-:( Thanks for your help. I will keep checking and if I find the solution I will let everyone know..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top