on 2023 Nov 21 8:49 PM
I have a running total for each group of grades in my report that isn't calculating a field for absolutely no reason. It uses a formula to evaluate on a group change (previous lot pallet) and if a global variable n is within a date range:
global datevar n;
(
onfirstrecord or
{@PrevLotPallet} <> previous({@PrevLotPallet})
) and
n in {?Start Date} to {?End Date}
Commenting out the portion of the formula with n in it gets it to populate, but then it's getting a bunch of extra data in other groups (that i DO need to look at which is why i cant just filter it out in the selection). I haven't used global variables in a report before but it's reset to a default value for each group and then evaluated on each record to either update or stay the same, i set up a variable with whileprintingrecords to just show n and it's there at least.
I can't just have it default to null like other questions say, it's not supposed to be null. Any help on why it'd be null even though a formula says it should calculate and the value is definitely there?
I'm working in crystal reports 2020 if that helps.
Request clarification before answering.
Hi Tanner, this could be due to evaluation times in Crystal. With a manual running total, it's best to use 'whileprintingrecords' in order to have the formula evaluate properly down the report. e.g. As a sample running total:
whileprintingrecords;
global numbervar x:= x+ 1;Other things that affect evaluation times is when a formula calls another formula...this could even be due to the order that formulae are placed on the report canvas when on the same section. In those cases one can use evaluateafter() in formulae in order to set their order. Try using whileprintingrecords, in the formula you posted, to see if that resolves the issue first.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let us know if you find the issues are in fact due to the data...in that case please post the syntax from your formula(s), a screenshot of the values in question and what the expected amount should be and why.
One thing I forgot to mention, is that in the File menu > Report Options there are 2 options for handling Null values...they are not checked by default and can affect formulae based on fields that contain nulls.
| User | Count |
|---|---|
| 7 | |
| 7 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.