I have CR 10. I will try my best to explain by question. I am working on a report that gets data from sql and counts the number of lines. I count the user lines Individually. But I need to count grand total of each user and also in the end grand Total of all the users. . Here is my code:
shared numberVar RowsThisRecord;
shared numberVar GrandTotalRows;
stringVar Result := '';
numberVar RowCount := int((len({MEDICAL_REPORT_OBJECT.MRO_TEXT}) / 65)+ 0.99);
RowsThisRecord := RowCount;
GrandTotalRows := GrandTotalRows + RowsThisRecord;
UserTotalRows := UserTotalRows + RowsThisRecord;
numberVar i;
for i := 1 to RowCount do
(
Result := Result + mid({MEDICAL_REPORT_OBJECT.MRO_TEXT},(i*65) - 64, 70) + chr(10);
);
"Lines Recorded: " & RowCount & chr(13) & Result;
shared numberVar RowsThisRecord;
shared numberVar GrandTotalRows;
stringVar Result := '';
numberVar RowCount := int((len({MEDICAL_REPORT_OBJECT.MRO_TEXT}) / 65)+ 0.99);
RowsThisRecord := RowCount;
GrandTotalRows := GrandTotalRows + RowsThisRecord;
UserTotalRows := UserTotalRows + RowsThisRecord;
numberVar i;
for i := 1 to RowCount do
(
Result := Result + mid({MEDICAL_REPORT_OBJECT.MRO_TEXT},(i*65) - 64, 70) + chr(10);
);
"Lines Recorded: " & RowCount & chr(13) & Result;