Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Record Selection Post Reply Post New Topic
Author Message
pmcm
Newbie
Newbie


Joined: 27 Aug 2010
Location: United Kingdom
Online Status: Offline
Posts: 15
Quote pmcm Replybullet Topic: Record Selection
     Posted: 27 Aug 2010 at 12:33am
Hi can help me please? On the report I'm developing I've two parameter fields:
1)Site Selection
2)Category 1
 
i'm trying to set up the following record selection for each parameter field
IF {?Site Selection} <> '*' THEN
{mp_bdsPOApproveReceiptComparison;1.POSite} = {?Site Selection}
ELSE
{?Site Selection} = '*'
OR
 IF {?Category 1 } <> '*' THEN
{mp_bdsPOApproveReceiptComparison;1.CatCodesCode1} = {?Category 1 }
ELSE
{?Category 1 } = '*'
 
when running the report the IF statement related to {?Category 1} is ignored by the report and all records are returned. Can i create a second record selection to deal with {?Category 1}???
 
thanks for your help
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 27 Aug 2010 at 3:54am
how about something like this? 
 
local booleanvar keep := true;
IF {?Site Selection} <> '*' THEN
 IF {mp_bdsPOApproveReceiptComparison;1.POSite} <> {?Site Selection} THEN
  keep := false;
 IF {?Category 1 } <> '*' THEN
 IF {mp_bdsPOApproveReceiptComparison;1.CatCodesCode1} <> {?Category 1 }
  keep := false
 ELSE
  keep := true;
 
keep
 
typically, the record selection want to know to accept or reject a record, so it just needs to see true or false at the end of the formula
 
HTH
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum