Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Printing - how to do? PLEASE help! 1

Status
Not open for further replies.

z07924

IS-IT--Management
Feb 18, 2002
122
GB
Hello All!

I am using a selection criteria like..

table.status in ('A','B','C') OR
IF table.type = 1 then table.status = 'Z'

sure enough, the IF..THEN condition in the selection criteria slows down the report considerably. So I thought about a work around and changed the condition to

table.status in ('A','B','C','Z')

and whileprinting the report if the table.status = 'Z' and the table.type <> 1; I don't want to print that particular record.(No blank line either) Can someone please show me how to do this? Any help would be highly appreciated. thanks.
 
Hi !

If I follow you right this is how you can do:

If you right click your detail section and choose &quot;Format Section&quot;
you can click on the &quot;x+2&quot; button right of the &quot;Suppress&quot; check box.
In the formula editor you write your condition:
table.status = 'Z' and table.type <> 1

After that you mark the check box &quot;Suppress Blank Section&quot; in the Section Expert.

Hope this helps.

/Goran
 
This worked after I changed all db column fields to formulas
including the same condition as in detail format section.
For eg...I changed the table.column field to a formula similar to....
if table.status = 'Z' and table.type <> 1 then
&quot;&quot;
else
table.column

ONe more problem. I use Count(records) in report footer to show total. With the above approach it is giving all the recs originally from db NOt the no of recs in the report .
Any help in solving this? thanks.
 
Hi !

Yes, If you suppress some records your total will be wrong.
Instead you can use a Running Total.
And there you use a formula to Evaluate.
In the formula you just write when you want your
counter to increase.

/Goran
 
You could try adding another line to your selection formula like this:

table.status in ('A','B','C','Z')
and
not (table.status = 'Z' and type <> 1)

See how it performs. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
great! that works like a champ. Thanks a lot for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top