Printing out report parameters with no record selection match.

I have a report parameter that accepts multiple, user entered items.  User would like to see a list of any entered parameter values that do NOT get a record from the database table.  This is a char field in the database.

It's a quick query, so I could use a subreport. The report outputs as a crosstab with store #'s for rows and items for column and is exported to Excel.  The list of not found items could go in report footer or header or somewhere......
DatakatCrystal Report DesignerAsked:
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:
Which database field does the parameter refer to?

mlmcc
DatakatCrystal Report DesignerAuthor Commented:
The report selects UPC by Store and sum of number sold for user entered date range. The parameter refers to UPC#. The user wants a list of any UPC they entered that has no counts sold. Obviously those will not have any records selected.
mlmccCommented:
Try this

IN the report header add a formula
Name - DeclareVariables
WhilePrintingRecords;
Global StringVarArray Parms;
Local NumberVar Index;

ReDim Parms[UBound({?UPCParameter})];
For Index := 1 to UBound({?UPCParameter}) do
     Parms[Index] := {?UPCParameter}[Index];
''

Open in new window


IN the detail Section add a formula
Name - DeleteFounds
WhilePrintingRecords;
Global StringVarArray Parms;
Local NumberVar Index;

For Index := 1 to UBound({?UPCParameter}) do
     If {UPCField} = {?UPCParameter}[Index] Then
          Parms[Index] := '';
''

Open in new window


In the report footer add a formula
Name - DisplayMissing
WhilePrintingRecords;
Global StringVarArray Parms;
Local NumberVar Index;
Local StringVar MissingParms;

For Index := 1 to UBound({?UPCParameter}) do
     If Parms[Index] <> ''then
           MissingParms := MissingParms + Parms[Index] + chr(13);

If MissingParms = '' then
      'All parameter values had records'
Else
     MissingParms

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
DatakatCrystal Report DesignerAuthor Commented:
Perfect!! Thanks.
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.