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

selecting records to print in a group

Status
Not open for further replies.

ultimatewilliam

Programmer
Oct 16, 2002
57
SG
my records are

FIELD1 FIELD2

A AA
A BB
A CC
A XX
A EE
A FF

B DD
B CC
B XX
B AA
B BB

there are two groups, A & B. I need crystal to print the records in Group A until it reaches record XX, disregards record EE & FF and start printing Group B also untill record XX only. how is this possible? thanks!
 
Add a rule in select expert that says:

FieldB < EE

Which will keep these records completely out of the report, or you can suppress the details with a condition that says:

FieldB >= EE

which will keep the records in the report, and in the totals, but will not allow them to print. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
sorry about my sample, but i must be able to print the records that are > EE. i just need crystal to stop printing the rest of the records after printing XX regardless of its value. in my previous example, EE & FF will not be printed in group A, AA & BB will not be printed in group B. I does not matter also how many record will be printed and not printed, just stop after XX. thanks!
 
I think you will need a boolean variable. You may need to split the details into A and B. A to flip the variable, B to print your data.

//formula in group header:
WhilePrintingRecords;
BooleanVar Stop :=false

//formula on a suppressed detail band (Details A)
WhilePrintingRecords;
BooleanVar Stop;
if {field} = &quot;XX&quot;
then Stop:= True
else Stop:=Stop

//Suppress formula for Details B:
WhilePrintingRecords
BooleanVar Stop

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top