Gerhardpet
asked on
Crystal report formula
I have a report where I'm trying to use a formula to look in the details section for a variable and pass that to the header as a declaration numbervar.
Then in the footer I want to print a message based on what the declaration is in the header
I'm attaching the report here.
Vendor Flag Checker (in the detail section)
Vendor Flag Starter (header)
Vendor Flag Display (message in footer)
test formula (test formula to test Vendor Flag Starter)
I can't get it to work for the Vendor Flag Checker (header) to declare the value to test formula (footer)
Anyone who can help me?
EIS-Order-Confirmation-EE.zip
Then in the footer I want to print a message based on what the declaration is in the header
I'm attaching the report here.
Vendor Flag Checker (in the detail section)
Vendor Flag Starter (header)
Vendor Flag Display (message in footer)
test formula (test formula to test Vendor Flag Starter)
I can't get it to work for the Vendor Flag Checker (header) to declare the value to test formula (footer)
Anyone who can help me?
EIS-Order-Confirmation-EE.zip
ASKER
Still not working.
Did the formulas as per your suggestions and it does not print the message.
Also testing with this formula I get 0 as a value
Appreciate your help Michael!
Did the formulas as per your suggestions and it does not print the message.
Also testing with this formula I get 0 as a value
whilereadingrecords;
numbervar perferedlflag;
perferedlflag
Appreciate your help Michael!
You need to name all the variables the same.
YOu have both perferedlflag and perferedflag
mlmcc
YOu have both perferedlflag and perferedflag
mlmcc
ASKER
Yes notice that in the test formula I had the spelling wrong. Now I have double checked and all spellings are correct but still no luck.
Not working. As far as I know the test formula should return a value of 2 and it is 0
Not working. As far as I know the test formula should return a value of 2 and it is 0
Did you try the report I uploaded?
mlmcc
mlmcc
ASKER
My report was saved in CR XI. It shouldn't matter but it is possible.
Upload your latest version.
mlmcc
Upload your latest version.
mlmcc
ASKER
Here is the latest version
This is for an old Sage ERP using run time crystal 10 and if reports are edited with a newer version I get errors
EIS-Order-Confirmation---Plain-P.rpt
This is for an old Sage ERP using run time crystal 10 and if reports are edited with a newer version I get errors
EIS-Order-Confirmation---Plain-P.rpt
Don't suppress the formulas. They tend not to execute.
If you don't want to display anything use this trick
THe formula now calculates what you want but it displays a null/empty string.
Change your test formula to use the WhilePrintingRecord. If you evaluate it in the Reading Records pass the other formulas haven't been evaluated yet.
mlmcc
If you don't want to display anything use this trick
WhilePrintingRecords;
global numbervar perferedflag;
if {INVENTORY.PREFERRED_VENDOR} = "9MMAG" then
perferedflag := 1;
""
THe formula now calculates what you want but it displays a null/empty string.
Change your test formula to use the WhilePrintingRecord. If you evaluate it in the Reading Records pass the other formulas haven't been evaluated yet.
mlmcc
ASKER
The formulas are working now. But still one small problem remaining. I want to print the display formula in the Page Footer. It prints on the Page Footer on the first page but not the second page.
I have a Page Footer where it prints other content. It prints on all pages but my display formula will only print on the first page. The display formula is in the same Page Footer.
Any ideas why?
I have a Page Footer where it prints other content. It prints on all pages but my display formula will only print on the first page. The display formula is in the same Page Footer.
Any ideas why?
No idea
mlmcc
mlmcc
You are talking about the {@Vendor Flag Display} formula, correct?
You set the variable in the detail section, so the result that you get from that formula in the page footer will depend on the values in INVENTORY.PREFERRED_VENDOR in the detail records on each page. If that's not what you're seeing, I don't know why.
FWIW, I did notice that {@test furmula} (which is also in the page footer) is using WhileReadingRecords, while the other formulas that use that variable are using WhilePrintingRecords, so the results that you get from {@test furmula} may not match what's in the other formulas.
James
You set the variable in the detail section, so the result that you get from that formula in the page footer will depend on the values in INVENTORY.PREFERRED_VENDOR
FWIW, I did notice that {@test furmula} (which is also in the page footer) is using WhileReadingRecords, while the other formulas that use that variable are using WhilePrintingRecords, so the results that you get from {@test furmula} may not match what's in the other formulas.
James
Actually, now that I look at it again, since you only set the variable if PREFERRED_VENDOR has a specific value, the result that you get from {@Vendor Flag Display} in the page footer will depend on what was in PREFERRED_VENDOR in all of the records up to that point, not just the records on each page.
James
James
ASKER
James,
I think you are correct. When I use this test formula it declare a 1 on the first page and zero on the second page.
On the order I only need to have 1 SKU where PREFERRED_VENDOR = "VENDOR" and all other SKU's could be "VENDORXX". When the variable finds one record = "VENDOR" then it should display the messages on all pages.
Does that make sense? Do you have any idea how I could make this work?
I think you are correct. When I use this test formula it declare a 1 on the first page and zero on the second page.
WhilePrintingRecords;
global numbervar perferedflag;
perferedflag
On the order I only need to have 1 SKU where PREFERRED_VENDOR = "VENDOR" and all other SKU's could be "VENDORXX". When the variable finds one record = "VENDOR" then it should display the messages on all pages.
Does that make sense? Do you have any idea how I could make this work?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
There can be multiple vendors on the report and I only want PREFERRED_VENDOR = "9MMAG"
Will the Sum formula work then?
Will the Sum formula work then?
ASKER
I can't believe how much time I spent on the report.
James, your idea works just like I wanted and was easy to do. Thanks for your help.
James, your idea works just like I wanted and was easy to do. Thanks for your help.
You're welcome. Glad I could help.
James
James
You need to add WhilePrintingRecords to the formulas.
Vendor Flag Starter
Open in new window
Vendor Flag Checker
Open in new window
Vendor Flag Display
Open in new window
mlmcc
EIS-Order-Confirmation-EE.rpt