INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Formula loses value in page footer.

Formula loses value in page footer.

(OP)
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.

RE: Formula loses value in page footer.

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

RE: Formula loses value in page footer.

(OP)
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.



RE: Formula loses value in page footer.

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close