Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2016 : Report Design
Message Icon Topic: Parameter Question Post Reply Post New Topic
Author Message
cbaldwin
Groupie
Groupie


Joined: 09 Apr 2014
Location: United States
Online Status: Offline
Posts: 79
Quote cbaldwin Replybullet Topic: Parameter Question
    Posted: 13 May 2019 at 5:09am
I have a report with {comment} fields. I want to create an optional parameter that excludes line items that have a comment field that include the word "Screen". I have played around with a NOT LIKE "*Screen*" in the Select statement and that works fine but i am not sure how to make this work based on a optional parameter entry. Suggestions????
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 8991
Quote DBlank Replybullet Posted: 13 May 2019 at 5:24am
are you always using the same word?
If so make it a required filter and set it to a true false and use that in your select criteria
(filter=FALSE or (filter=TRUE And table.field NOT LIKE "*Screen*"))

you can set the select filter as something like "include Screen" and "Exclude screen" instead of true/false
IP IP Logged
cbaldwin
Groupie
Groupie


Joined: 09 Apr 2014
Location: United States
Online Status: Offline
Posts: 79
Quote cbaldwin Replybullet Posted: 13 May 2019 at 5:39am
In your example is "filter" the parameter name or are you using the Filter function within crystal?

The word will always be "Screen". I just want to see the data associated with it sometimes and not see the associated data at other times.

Im not sure what a "Required Filter" is?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 8991
Quote DBlank Replybullet Posted: 13 May 2019 at 7:22am
sorry yes the filter would be the runtime parameter you create like "Has Screen Included".
{?HasScreenIncluded}=False
after crystal xi i think optional parameters were available and you can use the HasValue() function to see if a param was being used by the person running the report.
IP IP Logged
cbaldwin
Groupie
Groupie


Joined: 09 Apr 2014
Location: United States
Online Status: Offline
Posts: 79
Quote cbaldwin Replybullet Posted: 13 May 2019 at 7:48am
Thanks. That worked.
Ended up with this Select Statement.

({?Rmv_Spcl_Antgn_Ordrs}="N" or ({?Rmv_Spcl_Antgn_Ordrs}="Y" and isnull ( {Cmnd_cjb.COMMENTS}) or NOT({Cmnd_cjb.COMMENTS} LIKE "*Screen*")))

This works to still display my Null values for Comments and all of my Comments that do not in include "Screen" when the parameter is selected.

Thanks
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.047 seconds.