TReport how to protect a data-group to be splitted ?

TReport how to protect a data-group to be splitted ?

Postby ukoenig » Mon Aug 03, 2015 5:55 pm

Hello,

I noticed a splitting of data-groups
Is there a way, to force a pagebreak to keep a group complete at pageend ?

from samples :
the second line is shown on the next page
the screenshot shows a page-end and the start on next page

Image

best regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: TReport how to protect a data-group to be splitted ?

Postby James Bott » Tue Aug 04, 2015 2:44 pm

Uwe,

I tried to modify the TReport class do this a long time ago, but it was very difficult. You have to read the entire group in before you start printing the group, so you know how many lines long it is. Then there are more complications, such as what if the group is longer than one page? You also have to account for margins, line separators, totals, headers, footers, etc.

I'm not saying it can't be done, but it will require a lot of work.

My code won't help because it was actually done for memo fields, not groups, and it never did work properly.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TReport how to protect a data-group to be splitted ?

Postby ukoenig » Tue Aug 04, 2015 5:18 pm

James,

thank You for the infos.

These reports are only for internal use, nothing special.
I could count the lines to the last bottomline of a complete section.
Reaching this line, forcing a EJECT and starting with a new page.
I couldn't find a solution to do a EJECT on a defined line.
Do You have a working sample ?

best regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: TReport how to protect a data-group to be splitted ?

Postby James Bott » Tue Aug 04, 2015 9:11 pm

Uwe,

Hmm, I wrote that maybe 15 years ago, so the source will be hard to find. It's probably on some floppy disk in my garage archives. And, as I said, it wasn't working properly.

Here is a rough outline of what you will need to do. You have to use bPostGroup to:

1) Save the current record number
2) Save the current page line
3) Count how many items are in the next group
4) Consider how many lines are in any group and page footers. This will be tricky since you have to be sure there is enough room for the next group (including any group footer) and if there is enough room for the page footer (if any), before you can decide if there is room for the next group on the same page.
5) Then return to the saved record number and continue with the next group, or page feed and then continue with the next group.

I'm sure I have left something out, but that is a good start.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 45 guests