SETUP A FLAG USING A GLOBAL VARIABLE

I want to setup a flag in the beginning of the report to zero.
Then I want to count, while printing records, how many times the items in the report were back order.
At the end of the report I want to be able to put that summarize count.
Carlo VasquezAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
A couple of ideas come to mind.

The simplest
Create a formula - the test is how you determine if it is back ordered
Name - IsBackOrdered
If [b]({YourField} = 'BackOrdered')[/b] then
     1
Else
     0

Open in new window


Put it on the report in the detail section
Right click it
Click INSERT SUMMARY
Set the summary to SUM
Put it in the report footer

Using the method you propose
Add a formula to the report header
Name - DeclareVariables
WhilePrintingRecords;
Global NumberVar BackOrderCount;
BackOrderCount := 0;
''

Open in new window


Add a formula to the detail section
WhilePrintingRecords;
Global NumberVar BackOrderCount;
If [b]({YourField} = 'BackOrdered')[/b] then
     BackOrderCount := BackOrderCount  + 1;
''

Open in new window


IN the report footer add a formula
Name - DisplayBackOrderCount
WhilePrintingRecords;
Global NumberVar BackOrderCount;

BackOrderCount

Open in new window


mlmcc

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
James0628Commented:
A running total might be another option.  Create a running total on one of your fields, make the summary type a count, and under Evaluate select "Use a formula", and enter whatever test you use to detect a backordered item.

 James
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.