Print Page | Close Window

"formula cant used because evaulated later"error

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=5573
Printed Date: 18 May 2024 at 10:17am


Topic: "formula cant used because evaulated later"error
Posted By: oyken
Subject: "formula cant used because evaulated later"error
Date Posted: 22 Feb 2009 at 10:26pm
Hello every1 Smile
I am having trouble with duplicates.I tried to make a report with using "next" command on formula field but then getting an error like "this formula
cant be used because it must be evaulated later"... Cry
The report will be like ;
 {field 1}    {field 2}
 AAA            10
 AAA            10
 BBB             5
 CCC            20
 CCC            20
 CCC            20
 
my formula is like " if {field 1}=next({field 1}) then 0 else 1
then i dont want the raport to shows "0" but with selection expert i cant select the formula or i cant use "insert summary" with selecting this
formula.
Also i cant make it with supress because i need sum of {field 2} after i sort out these duplicates.How can i make this ???
Thanks ....



Replies:
Posted By: rahulwalawalkar
Date Posted: 23 Feb 2009 at 12:43am

Hi

Right Click the formula field in Design View Select Format Field then in Common Tab in Format Editor Click X+2 against Suppress and enter the code
 
mailto:%7b@FormulaFieldName%7d=0 - {@FormulaFieldName}=0
 
then getting sum for the field 2
 
Create a formula
 
Frm_Accumulate
WhilePrintingRecords;
NumberVar SumField2;
 
SumField2 := SumField2 + Field2;
 
Frm_FinalSummary
WhilePrintingRecords;
NumberVar SumField2;
 
SumField2 := SumField2 + SumField2
 
Cheers
Rahul
 


Posted By: oyken
Date Posted: 23 Feb 2009 at 12:49am
will try it when possible ...
lots of thanks for reply :)


Posted By: oyken
Date Posted: 23 Feb 2009 at 1:21am
unfortunately it didint work or i made something wrong.
First of all supress wont work because even you supress the duplicated values it still count in summary.
So i need to sort out these duplicated values instead of supress.
And another question ...
will i put Frm_Accumulate and Frm_FinalSummary on detail section ?
tbh i didint understand the meaning of Frm_FinalSummary
 
thanks again :)


Posted By: rahulwalawalkar
Date Posted: 23 Feb 2009 at 3:56am
Frm_Accumulate
 
Will go in details section you can suppress it as you don't want to show the results of that....
 
and Frm_FinalSummary in report footer
 
Cheers
Rahul
 


Posted By: oyken
Date Posted: 23 Feb 2009 at 5:54am
here what i have got after tried it
 
field 1 field 2 suppress frm accumulate frm finalsummary
AAA 10   10  
AAA 10 1 20  
BBB 5   25  
CCC 20   45  
CCC 20 1 65  
CCC 20 1 85  
        170
I guess i coulldnt understand u clearly but thanks for your helps :))
the formula works fine
 
whileprintingrecords;
numbervar summary;
if previousisnull({field 1}) then summary:={field 2} else
if {field 1}<>previous({field 1}) then
summary:={field 2} + summary else
summary
 
but the problem is i cant use the formula that has "next" or "previous" commands on record selection.
My problem is to find a way to solve this.If there is a way that u can recommend i will be pleased ...
 



Print Page | Close Window