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

Using WhilePrintingRecords

Status
Not open for further replies.

anushka04

Technical User
Jul 7, 2005
28
GB
Need help people, used the formula long time ago and I think ive forgotten how to use it now.
WhilePrintingRecords

I am trying to extract data only from these records which meets two different codintions on the same filed.

E.g
Customer Paper Conditionfield
1 A 1
1 A 2
1 A 3

I want to only extract the records for conditionfield 1 and 2

Can any body help??


I know u need to use the WhilePrintingRecords formula but not quite sure how i go about it.
 
This has nothing to do with whileprintingrecords.

whileprintingrecords is a state of the report as Crystal is a 3 pass system.

They are:
beforereadingrecords
whilereadingrecords
whileprintingrecords

To limit rows being returned, use the Report->Edit Selection Formula->Record and place something like:

{table.conditionfield} < 3

If it's a string type data, use:

{table.conditionfield} in ["1","2"]

The above menu traversing describes Crystal 8.5 and below, your menus may vary, and in future posts, please remember to post your software version.

-k
 

Thank you for the answer. Sorry the version of CR is 8.5

I have the records limited as you have suggested already, but i want to only include these records and summerise at grouping level - Customer - paper for condionfiled 1 and 2

if the condionfiled is 1 or 2 at the paper level i want exclude it

i want to only include it if condtionfiled is 1 and 2 at paper level grouping
 
You should have said what you'd already tried. It's also not clear what you're after.

Do you mean that you want to include just those groups that have a level 1 and a level 2?

One solution is to have the table twice, the second time as an alias. The first instance is just level 1, the second just level 2. Link them and you only get a 'row' when both exist for whatever-it-is you group on.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Sorry I am not explaning my self well.

Ok This what i want to do..

eg.

Record Customer Paper Conditionfield
1 1 A 1
2 1 A 2
3 1 A 3
4 1 A 4
5 2 A 1
6 2 A 2
7 3 A 2
8 4 A 1

from these records I want the report to only show
record 1,2,5,6 for customer 1 and 2 because for the same customer and same paper it meets the Conditionfield 1 and 2

Thanks for the help



 
First use a record selection formula of:

{table.conditionfield} in [1,2]

Then go to report->edit selection formulas->GROUP and enter:

distinctcount({table.conditionfield},{table.paper}) = 2

This assumes that you your grouping is first on customer and then on paper.

-LB
 
Top Man!!!
Thank you for the help it seems to have worked..

Only further question when i try to export the data it exports more than what it shows on the screen, is there anything i can do on this

What i mean it exports data which are suppressed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top