Is there any way to prevent the resetting of variables on a new page?
In GH2 I initialize the following variable:
WhilePrintingRecords;
Global NumberVar RCountDaysInDenominator := 0;
In GF3:
EvaluateAfter ({#IsEndExamPopulated});
if {#IsEndExamPopulated} = True
then
NumberVar RCountDaysInDenominator := NumberVar RCountDaysInDenominator + 1
else
NumberVar RCountDaysInDenominator := NumberVar RCountDaysInDenominator + 0;
I didn't realize that when a single GF3 spans many pages, these variables reset.
Any suggestions? Thanks in advance!
Related
whileprintingrecords;
global numbervar DetailCount;
DetailCount := DetailCount + 1;
Global numbervar DetailCount;
DetailCount Mod 10 = 0
IF Remainder (RecordNumber, 8) = 0 THEN
TRUE
ELSE
FALSE
IF Remainder (RecordNumber, 8) = 0 and not OnLastRecord THEN
TRUE
ELSE
FALSE
i have try this codes but not get it.
Please describe better what you would like to print on each page.
I'm guessing you would like to print a summary that would only show the sum of one printed page.
You need 3 formulas:
sum_pagesum (should be placed in the details-section as hidden field):
whileprintingrecords;
numbervar pagesum;
pagesum:= pagesum + {WHATEVER};
current_pagesum (should be placed in the page-footer-section, this prints your sum):
whileprintingrecords;
numbervar pagesum;
pagesum;
reset_pagesum (should be placed in the page-footer-section after the current_pagesum)
whileprintingrecords;
numbervar pagesum;
pagesum:= 0;
I am creating a report...
Its a kind of Ledger Report..
I am displaying the report Groupwise by Name.
See the below image displaying the error...
Now see the red marking in the image...
I created the formula shown below..
d_ClosBal
WhilePrintingRecords;
NumberVar ClosBal1;
ClosBal1 := 0;
ClosBal1 := Sum({#DebitAmt}) - Sum({#CreditAmt});
IF ClosBal1 > 0 then ClosBal1 else 0;
c_ClosBal
WhilePrintingRecords;
NumberVar ClosBal1;
ClosBal1 := 0;
ClosBal1 := Sum({#DebitAmt}) - Sum({#CreditAmt});
IF ClosBal1 < 0 then ClosBal1 else 0;
And Placed formula in the yellow mark shown in the figure below...
The Sum({#DebitAmt}) is 5740.00 and Sum({#CreditAmt}) = 800.00 shown in figure
The blue marked are the Transactions, ex 1000.00, 945.00, etc....
I even tried putting a formula reseting the value of ClosBal1 to 0 inside GroupHeader but ain't helped.
Suggest me any solutions..
you need to indicate your group levels in this statement otherwise you are just grouping the entire report.
ClosBal1 := Sum({#DebitAmt}) - Sum({#CreditAmt});
example
ClosBal1 := Sum({#DebitAmt},{companyname}) - Sum({#CreditAmt},{companyname});
How can I concatenate this a date in Crystal Reports after split it.
I have this formula:
global numberVar d :=toNumber(mid({BAQReportParameter.Option01},4,2));
global numberVar m:= toNumber(left({BAQReportParameter.Option01},2));
global numberVar y:= toNumber(right({BAQReportParameter.Option01},4));
Global stringVar datetxt;
datetext := ToText(d) + "/" + ToText(m) +"/" + ToText(y);
but it has an error.
global stringvar d :=(mid({BAQReportParameter.Option01},4,2));
global stringvar m:= (left({BAQReportParameter.Option01},2));
global stringvar y:= (right({BAQReportParameter.Option01},4));
Global stringVar datetxt:= ToText(d + "/" + m +"/" + y);
Do this simple changes it will work!!
I have this formula field:
global numbervar TotDiff;
WhilePrintingRecords;
if {#QuantExceding} <> 0 then
TotDiff := TotDiff + ABS({#QuantExceding})
else
TotDiff := TotDiff
Initially, the if clause was not there, so I thought it was ABS erroring out when passed 0. Then I see that whatever I do with QuantExceding, when it equals 0, the reports errors out and highlights the first line of the if or whatever the line that invokes QuantExceding
Any ideas ?
change formula like this and make sure the {#QuantExceding} is evaluating first:
WhilePrintingRecords;
EvaluateAfter({#QuantExceding});
global numbervar TotDiff;
if {#QuantExceding} <> 0 then
TotDiff := TotDiff + ABS({#QuantExceding})
else
TotDiff := TotDiff
i want to print missing records in crystal report .
i am using below formula in the report and i have placed this formula in details b section.
details a has normal report fields.
formula:
local numbervar firstemp; // first Emp#
local numbervar nextemp; // next Emp#
local numbervar diff; // difference between firstemp and nextemp
local numbervar increase; // increment for missing Emp#'s
local numbervar result;
increase := 0;
firstemp := tonumber({getRptSalesSummery;1.Bill_Id});
nextemp := tonumber(next({getRptSalesSummery;1.Bill_Id}));
nextemp := nextemp -1;
diff := nextemp - firstemp;
if nextemp = firstemp
then ""
else (
while diff >= 1
do (
diff := diff - 1;
increase := increase + 1;
result := firstemp + increase;
exit while;
);
totext (result,"0000") & chr(13);
)
this formula is not giving me range.
for example if in report there is range of 1 to 10 and 6,7,8,9 is missing records, then if i check in the report its printing 1 to 5 and 6 as missing then directly 10, but its not giving me 7,8,9.
basically i required range of missing records