My workplace is currently upgrading from Crystal 8.5 to Crystal 10, both using databases created using SQL 8. A problem occurred with a report that had been running for more than a year with no problems before the upgrade. It does not use the parameters directly: instead it checks them and assigns a value if they have not been entered:
This is something which I wrote while I was much less experienced in Crystal, and I'd do it differently now. After all, a date parameter always defaults to the current date. But it was still very surprising that it caused a blank to be displayed, even though no attempt was made to use the value in question.
Upon investigation, I found that there were no problems if the reference was to a Null value in an existing record. But for unknown reasons, no records were being read for the DateControl table. And when there was no such record, the ‘road not taken’ formula. And the same thing happens in Crystal 8.5; if there are no occurrences of a record, a conditional reference to it kills the formula even when it is not used.
I'm re-writing the report so that the problem should not occur at all. But does anyone understand what's going on here?
Madawc Williams (East Anglia, UK) ![[yinyang] [yinyang] [yinyang]](/data/assets/smilies/yinyang.gif)
Code:
if isnull ({?Date_To})
or {?Date_To} = date(0,0,0)
then {DateControl.DateStamp}
else {?Date_To}
Upon investigation, I found that there were no problems if the reference was to a Null value in an existing record. But for unknown reasons, no records were being read for the DateControl table. And when there was no such record, the ‘road not taken’ formula. And the same thing happens in Crystal 8.5; if there are no occurrences of a record, a conditional reference to it kills the formula even when it is not used.
I'm re-writing the report so that the problem should not occur at all. But does anyone understand what's going on here?
![[yinyang] [yinyang] [yinyang]](/data/assets/smilies/yinyang.gif)
![[yinyang] [yinyang] [yinyang]](/data/assets/smilies/yinyang.gif)