Print Page | Close Window

Parameter Question

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22770
Printed Date: 28 Apr 2024 at 1:14pm


Topic: Parameter Question
Posted By: cbaldwin
Subject: Parameter Question
Date 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????



Replies:
Posted By: DBlank
Date 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


Posted By: cbaldwin
Date 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?


Posted By: DBlank
Date 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.


Posted By: cbaldwin
Date 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



Print Page | Close Window