Print Page | Close Window

Dynamic Suppress

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=14513
Printed Date: 02 May 2024 at 7:15pm


Topic: Dynamic Suppress
Posted By: GunChild
Subject: Dynamic Suppress
Date Posted: 27 Sep 2011 at 11:29am
I got three types of report which show and hide according to what is needed. My problem is how do I suppress if the fields that contains with a text 'KLP*' and 'WRT*'.

Here is the example code that I put in the object.

//Len({sql_DB_1.fld_Grump})=WRT*
not(isnull{sql_DB_1.fld_Grump}))like 'KLP','WRT'))

I want to suppress the object if the fld_grump has the value of klp and wrt.



Replies:
Posted By: DBlank
Date Posted: 27 Sep 2011 at 11:55am
{sql_DB_1.fld_Grump} like ["klp*","WRT*"]


Posted By: GunChild
Date Posted: 27 Sep 2011 at 12:03pm
suppress if {sql_DB_1.fld_Grump} like ["klp*","WRT*"]

Suppress if it contains with KLP wrt?
tried it no luck


Posted By: DBlank
Date Posted: 27 Sep 2011 at 12:12pm
the formula i gave you is a row level or field level suppression option.
there is no "If" in it, just the boolean reulst of this:
{sql_DB_1.fld_Grump} like ["klp*","WRT*"]
 


Posted By: GunChild
Date Posted: 28 Sep 2011 at 4:49am
much better if I do this way?

left ({sql_DB_1.fld_Grump},6)="klpWRT"

I haven't tried this yet.


Posted By: DBlank
Date Posted: 28 Sep 2011 at 4:54am

these are in the same field for the same row?

{sql_DB_1.fld_Grump} like ["*KLP*WRT*","*WRT*KLP*"]


Posted By: GunChild
Date Posted: 28 Sep 2011 at 6:47am
or I should say if the report contains a field with klp i want to suppress the object.


Posted By: DBlank
Date Posted: 28 Sep 2011 at 6:50am
I cannot understand your request.
To help, please show some sample row level data (with any grouping) and exactly what you want suppressed with why (for that row)


Posted By: GunChild
Date Posted: 28 Sep 2011 at 7:01am
{sql_DB_1.fld_Grump) = "klp" "WRT

if those two words (klp and wrt) is pull from the DB i want to suppress the selected object.

here's what i did.
1. image right click -> format graphic
2. check the suppress box
3. click the x-2 icon
4. formula.

My question above is what formula do i put if the field grump pulls the record klp or wrt.


Posted By: DBlank
Date Posted: 28 Sep 2011 at 7:04am
where are you placing the graphic? Detail, Group header, footer...???


Posted By: GunChild
Date Posted: 28 Sep 2011 at 7:04am
it's on the detail


Posted By: DBlank
Date Posted: 28 Sep 2011 at 7:08am
Please show some sample row level data from the sql_DB_1.fld_Grump field, explaining in each row why the image on its related row should be suppressed or why it should be shown.


Posted By: GunChild
Date Posted: 28 Sep 2011 at 7:13am
I had one image and one field which is fld_grump.
if the fld_grump has an output of klp I want to hide the image.



Posted By: DBlank
Date Posted: 28 Sep 2011 at 7:22am
still not anwereing my question for some sample data but i will try again.
right click on the image
select format graphic
select common tab
select the formula box (X-2) to the right of the 'Suppress' option
enter the suppression criteria here
{sql_DB_1.fld_Grump) like "*klp*"
 


Posted By: GunChild
Date Posted: 28 Sep 2011 at 7:30am
{sql_DB_1.fld_Grump) like "*klp*"
if the field is equal to klp then image will suppress?


Posted By: DBlank
Date Posted: 28 Sep 2011 at 7:41am
if the field has 'klp' anywhere in the string
examples:
"I am a klp row" - suppresses
" I am a kl p row" - does not suppress
"abcdeklpwxy" - suppresses
"klp" - suppresses
 
if it is always just klp with no other letters before or after you can use
{sql_DB_1.fld_Grump) ="klp"


Posted By: GunChild
Date Posted: 28 Sep 2011 at 7:50am
left ({sql_DB_1.fld_Grump,3)="klp"
much better if I used this
Thanks for your help sir



Print Page | Close Window