FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TReport how to protect a data-group to be splitted ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
TReport how to protect a data-group to be splitted ?
Posted: Mon Aug 03, 2015 05: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



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.
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: TReport how to protect a data-group to be splitted ?
Posted: Tue Aug 04, 2015 02: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: TReport how to protect a data-group to be splitted ?
Posted: Tue Aug 04, 2015 05: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.
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: TReport how to protect a data-group to be splitted ?
Posted: Tue Aug 04, 2015 09: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion