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!

Column layouts - Keeping groups together? 1

Status
Not open for further replies.

uczmeg

MIS
Mar 7, 2001
61
GB
Hi,

I'm trying to save a few trees by making a 'thin' report use multiple columns.

If I do this I really need my groups to stay together rather than get split across columns. Using 'keep group togther' works fine between pages, but doesn't seem to between columns.

Is it possible to make it work correctly?

Cheers
Marc
 
I know of no way to insure your group stays together except to start each group in a new column. To do this, in the group expert hilite your group footer and check the box "print at bottom of page".

MrBill
 

Thanks for the reply Bill. It was the answer I was expecting, if not hoping for!

The groups are between 1 and 10 lines, so unfortunately starting each group in a column wouldn't help.
 
I've played around with this a little and I think I've found a solution that might work for you. My example assumes only 1 group (Home_Dept) and 60 lines of print between the page header and page footer. It prints employee numbers (Emp_No) in the detail section.

You must determine how many lines can print on a page between the page header and the page footer. All group header and footer sections that will be printed must be the same size as the detail section or an exact multiple of the detail section (ie. exactly twice as large or three time etc.) because you will need to manually count how many lines have printed.

Add two subsections to the group header giving you sections GH1a, GH1b, GH1c. Move the information you want to print for each group header into section GH1b. Suppress GH1c. Draw a line at the top of GH1a the width of the column and shrink GH1a as small as possible. GH1a will be the only section that is smaller than the detail section.

Create the following formulas:

// formula: @LineCnt - place in detail section.
WhilePrintingRecords;
NumberVar LineCnt;
If LineCnt < 60 then LineCnt:= LineCnt + 1 else
LineCnt:= 1

// formula: @LineCntColumnHd - place in GH1c (suppressed section).
WhilePrintingRecords;
NumberVar LineCnt;
If LineCnt + Count({ESYEMPLR.EMP_NO},{ESYEMPLR.HOME_DEPT}) >= 60 then
LineCnt:= 1 else
LineCnt:= LineCnt + 1;
LineCnt

// formula LineCntGrpFooter1 - place in group 1 footer.
WhilePrintingRecords;
NumberVar LineCnt;
If LineCnt <= 60 then LineCnt:= LineCnt + 1 else
LineCnt:= 0

// formula LineCntReset - place in page footer.
WhilePrintingRecords;
NumberVar LineCnt:= 0

Open the section expert and select GH1a. Conditionally "print at bottom of page" with following code:
WhilePrintingRecords;
NumberVar LineCnt;
LineCnt + Count({ESYEMPLR.EMP_NO},{ESYEMPLR.HOME_DEPT}) >= 60 and LineCnt > 0

Conditionally suppress group 1 footer with following code:
WhilePrintingRecords;
NumberVar LineCnt;
LineCnt > 60 or LineCnt = 1


If any of the printable section are greater than one line is size you must adjust the above formulas to properly count the number of lines printed.

I believe this will do what you need.

MrBill
 
Hi MrBill,

That looks great! Thank you! (You've probably saved a few trees too!)

I'll give that a try as soon as I can.

Cheers
Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top