SAP Knowledge Base Article - Public

1535182 - How to check if the Database Field is present in the list of Parameter

Symptom

How to check if Database Field is present in the list of Parameter

Environment

  • Crystal Reports XIR2
  • Crystal Reports 2008

Resolution

  1. Create the Formula in Crystal Report designer and drag it as per the logic to respective section of the report.
  2. To check if the Database Field is present in the list of Parameter created in the report we have to write the following code in formula :

             numberVar position;
             numberVar i:=0;
             stringVar grpName;
             booleanVar isGrpPresent:=false;

             while(i<ubound(<parameter>))
          do
             (
                  i:=i+1;
                  position:=InStr(cstr(<parameter>[i]),"-");
                  grpName:=mid({<parameter>[i],position+1);
                  isGrpPresent:=(<database field>=grpName);
                  if isGrpPresent=true then exit while;
             );

Keywords

Database Field , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

SAP Crystal Reports all versions