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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

While{PrintingRecords and Record Selection

Status
Not open for further replies.

gc6294

IS-IT--Management
Feb 23, 2004
56
US
I have a problem that I want to do a Record Selection on a Crystal 8.5 report based on a formula that uses a WhilePrintingRecords function. The report is a sales report - when it hits an item of a certain type it assigns a string "TEST TYPE" for the remainder of items in the order until the order number changes (then it will reset itself to ' '). I want to exclude those lines where it doesn't assign the string (where the value is blank). I can't use this formula in the Record Selection. Ideally, would like only to grab those items where it returns "TEST TYPE". Any thoughts on how to get around this? Thanks
 
I think you will have to use the formula in the body of the report and use section suppression to exclude the records that don't meet your criterion.

-LB
 
Can you do section suppression in 8.5? Not sure where?
 
Yes. Go to format->section->details. Let's say you created your formula in the formula editor (insert->field explorer->formula->new) and you place the formula in the details section. You would then go into the section expert->details->suppress->x+2 and enter something like the following:

{@yourformula} = ''

-LB
 
thanks LB - Sounds like you are on to something but I just can't get it to work.. Still shows all records.. must be something I am doing...
 
Please post your formula and all embedded formulas.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
My formula for determining the testtype is:
WhilePrintingRecords;
StringVar ItemNo;

If {Itemmaster_SQL.commodity_cd} = "testtype" then
ItemNo := {Orderlinehistory_SQL.item_no} else
ItemNo := ItemNo

I then have a field that resets it in the Group Header
WhilePrintingRecords;
StringVar ItemNo := "";

So on change of invoice it resets it to blank. If while reading the records it finds a "testtype" all following records for that invoice will be "testtype" until it re-sets itself on the new invoice.
 
So let's say your formula is named {@testtype}. Then in the section expert with "detail" highlighted->suppress->x+2 and enter:

{@testtype} = ""

This assumes that you have the item numbers sorted in a way that makes sense for your purpose.

-LB
 
Thanks guys... must have been tired.. Tried the same thing 3 times .. finally looks like it worked... Thanks again to everyone
 
You need to be careful of your reset formula. If you repeat group headers on every page and your invoice is more than one page long, the reset will happen again when you may not want it to.

To prevent this, change your reset fomula to:

WhilePrintingRecords;
If Not InRepeatedGroupHeader then StringVar ItemNo := "";

Just out of curiosity, what software package are you using? This looks a lot like Macola, my specialty, but the tables names are slightly different.



Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top