Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula loses value in page footer.

Status
Not open for further replies.

raven4

Vendor
Jan 10, 2008
32
0
0
US
Crystal Reports Version 9

I have a very basic formula that does the following calculation:

If {Invoice.PRODUCT_CODE} = "BROAD" and {Invoice.BILL_AMOUNT} = 4295 then 11
else if {Invoice.PRODUCT_CODE} = "BROAD" and {Invoice.BILL_AMOUNT} = 895 then 2
else if {Invoice.PRODUCT_CODE} = "REG" then Round ({Invoice.BILL_AMOUNT}/395)

The formula works great if I drop it into the details section of the report, but I want to use it in a text box on the page footer. As soon as I put the formula in the PF it loses it's value. I tried creating a new ToText formula based on the first formula and it still loses the value.

Is it not possible to put formulas in a page footer?

Thanks.
 
Page footers are not a good place to try and display data. As they are usually one of the last parts of the report to be resolved by Crystal.

What are you trying to do?
How many pages in your report?

Ian
 
Just one page in the report. The details sections displays invoice details. And the page footer just has a bunch of informational text, such as "New this year!" into which I want to incorporate this formula. There is a group footer area that displays the invoice summary (total of products invoiced) but even if I put the formula there the value becomes 0.



 
If your group footer is showing 0 then that means your last record value for does not meet the criteria or the invoice.BILL_AMOUNT = 0

You can use a variable to capture the amount but you will need to define rules as to which record will hole the data you want.

@Eval -- place this in detail section and when working suppress but for testing/development leave visible so you can see what is happening
whileprintingrecords;

Global numbervar x;

If {Invoice.PRODUCT_CODE} = "BROAD" and {Invoice.BILL_AMOUNT} 4295 then x:= 11
else if {Invoice.PRODUCT_CODE} = "BROAD" and {Invoice.BILL_AMOUNT} = 895 then x:= 2
else if {Invoice.PRODUCT_CODE} = "REG" then x:= Round ({Invoice.BILL_AMOUNT}/395);

@display -- place this in group footer and in section expert set print at bottom of page, I don't think it will display in page footer.
whileprintingrecords;

Global numbervar x;

This will return value from last record if you want another record then you will need to change the conditions in the IF then else accordingly

Ian

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top