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

suppressing sections

Status
Not open for further replies.

johnjrd

MIS
Jun 6, 2001
54
GB
Hi

We are trying to produce a precompleted form full of student details such as name,address,enrolment and payment details. Everything is fine until we start trying to bring the payment records into the report.

Because we want to have 3 boxes for payments we obvioulsy need to decide whether we have a completed payment box or a blank payment box. So we have created 3 sub reports which have a text object in a report header and details section. The text object is the same in both apart from the details section has the fields to be pulled thru from the db. We are using the special field record number to try and use the suppress section option so we can condition these sub reports to display or not depending on the value of the record number. Now we can sort it so if a student has a payment records, everything works fine and i can also do a seperate form for blank records but i cant seem to merge them together so they work and check whether the student has a payment record or not.

Can anyone tell me what this record number does and how the suppress section works.

If you have any more questions let me know

thanks in advance

john
 
Well the suppress section is pretty straight forward.

You can either suppress a section unconditionally by
checking the box in the section expert or you can
suppress a section conditionally by clicking on the
'X+2' button to the right of the word 'suppress' and
enter an expression that will evaluate to true
when the section is to be suppressed and false otherwise.

So if I wanted to suppress a section if the student was male I would create the following expression:

{table.gender} = "M"

The record number is a somewhat arbitary number that Crystal assigns as it processes the records. The number assigned to a particular record will change as the selection, grouping and sorting options change.

I hope this helps. Howard Hammerman,

Crystal Reports training, consulting, books, training material, software, and support. Scheduled training in 8 cities.
howard@hammerman.com
800-783-2269
 
Ok so if i want to suppress based on the record number i can say something like

recordnumber = 1 or recordnumber <> 1 depending on the which section of the subreport i want to be displayed, however this seems to complicated by the fact i have 3 subreports (because i have 3 spaces on my form for payment details) which i either wanted to be filled with values from the db or just blank.

I think the problem lies where i get a student who has 1 payment record and i then need to display 2 blank boxes because this recordnumber is set to 1 i dont seem to be able to test for it

if anyone can think of another way of doing this it would be a great help
 
Hi John....let us back up a bit and analyze your approach to this.

You have said that you had a perfectly good report until you added payments to it...so

1. did this involve adding another table to the report??
2. are there 3 possible payments? ie. the table would contain 3 payment records max per student?
3. why do you have 3 subreports for this? I would think that if subreports are necessary (not convinced of that yet) then only one would be necessary....you could display all values of payments from one report...couldn't you? Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top