Hi Abhilash,
Thanks for the Help. I read the section Report Processing Model, which includes Multi-pass reporting
flow chart. I got to the point where it discusses pass 2, and it says "Crystal Reports does the following:"
Out of the 3 things it lists, Group selection formulas precedes Calculation of formulas marked
"WhilePrintingRecords." I am trying to understand if this order of evaluation is the problem of my
original approach using global variable to accomplish group selection. My approach is as follow:
//Formula to declare, place in report header.
Global BooleanVar HasRequiredData;
//Formula to initialize, place in group header.
Global BooleanVar HasRequiredData;
WhilePrintingRecords;
HasRequiredData := false;
// Formula to verify each grade, place in details section.
Global BooleanVar HasRequiredData;
WhilePrintingRecords;
If {grades.grade_prd_str}[5 to 6] = {?prmGradePrdStr} [5 to 6] Then
HasRequiredData := true;
// (debug) Formula to print the value of HasRequiredData, place in group footer.
WhilePrintingRecords;
Global BooleanVar HasRequiredData;
// Group selection formula
Global BooleanVar HasRequiredData;
WhilePrintingRecords;
If HasRequiredData = true Then
true
Else
false
With this approach, all group instances are printed, but details sections are all empty.
Any thoughts? Should I avoid using variables in Crystal Reports?
Thanks
Caroline