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!

Suppress section for first record on each page

Status
Not open for further replies.

DannyLondon

Programmer
Nov 19, 2002
33
GB
Hello all

I am trying to create a report which has a divider line between each detail, but not one above the first record on each page. I have created a DetailA section which has the line in it, and have been playing with formulae to suppress this section for the first record on each page.

Attempts to have a formula in the page header which resets a boolean value or record counter, which is then altered by the detail section, have proven to be frustratingly unfruitful.

It is not an option to move the line to the bottom of the detail, as I will then have to find code to prevent it on the last record.

I would also be interested in shading every second record, and imagine a similar algorithm could be used to the line suppression, once I can get it working.

Thanks...
 
Hi !

I suggest that you put the line in its own section and place it at the bottom.

In the format section you conditonally supress the section whith this formula:

OnLastRecord

Regarding the shadow you can try this one:
In the detail section on the color-tab you conditonally format the background color with this formula:

If remainder(recordnumber,2)=0 then Gray else NoColor

/Goran
 
Hi Goran

Thanks for your ideas. I have tried adding the OnLastRecord command to a section containing the line, but this only suppresses the line from the last record in the report, not the last record on each page.

I have also tried the shading idea, which is close to what I was looking for, but not quite. Your suggestion shades every second record, regardless of its position on the page. I would like the shading to be reset on each page, so the first record on each page is unshaded.

I hope you will be able to help further.

Thanks, Danny
 
Hi again !

Try this:
Create two formulas @counter and @reset_counter

You place the @counter formula in your detail section, and it looks like this:
WhilePrintingRecords;
NumberVar counter;
counter := counter +1


The @reset_counter formula is placed in the page footer and look like this:
WhilePrintingRecords;
NumberVar reset := 0


Suppress the two formulas and now you can try and shadow the details like this:
If remainder({counter},2)<> 0 then Gray else NoColor

You can use the same suppress option for your line in Detail A.

Hope it will help you.

/Goran
 
Hi Danny !

The suppress option shall be:

if {counter} = 1 then
true


/Goran
 
Hi Goran

Thanks for all of your help. Everything has worked wonderfully.

I originally had similar code, but used the page header to reset the counter. This gave very odd results, typically shading the first two records before alternating the shading. I also found that using your code in the page header causes the same results. Do you know what the difference between the page header and footer that would cause such an issue?

Thanks again, Danny
 
Hi again !

If you handle the first record in the formula I think you get the same result even if you put the reset-formula in the page header.

@reset
WhilePrintingRecords;
NumberVar counter;

if not OnFirstRecord then
counter := 0


/Goran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top