need help! with pageHeights and pagination

Alex Rice alrice at ARCplanning.com
Thu Aug 21 17:40:21 EDT 2003


I've posted about this before, and again comes a plea for help and/or 
ideas. This is the only bug I still have outstanding with my print 
routines in my app. The problem is that field lines often get clipped 
between between pages in my printouts.

- Please don't suggest the Report Object/Builder feature of Rev 2.0; 
It's useless for me and I have put in a lot of time studying it.
- Please don't suggest revPrintField. This isn't a field printing 
issue, it is printing of a very tall group with pagination.

The group hierarchy appears like this

ReportPrinting stack
   Card 1
     Report Group
        Section 1 Group
           Heading Fld
           Line Graphic
           Content Field
        Section 2 Group
           Heading Fld
           Line Graphic
           Content Field
        ...
        Section N Group

The printing algorithm is just this: set the size of the 
ReportPrintingStack to the paper size, and move the top of the grp 
"Report Group" negatively off the top of the stack for each page.

Consequently, any given field within the Report Group may or may not 
extend beyond the top or bottom of the stack. Some fields may be taller 
than the paper size. Those fields that extend off top or bottom of the 
stack usually have their lines clipped in the printout.

I've tried various different ways of adjusting both the stack height 
and the placement of the Report Group to compensate for the top and 
bottom clipping of fields. Nothing seems to work so far. I've really 
been banging my head on this. Anything is worth a try.

My last hope is to use a field's pageHeights property. Because there is 
no suitable field to read pageHeights from in my Report Group, I create 
a field on the fly, put on the card (but not in the group), set it to 
the loc and dimensions of Report Group, put a bunch of dummy text in 
it, then read the pageHeights from the field. I hope that if I scroll 
or move Report Group according to the pageHeights of the same sized 
field underneath it, then I will at least know exactly where the page 
boundaries will be, and possibly be able to adjust the fields being 
clipped. This should work, no?

Unfortunately I'm not even getting to that point: any field that I read 
the pageHeights property from, it always seem to have bogus numbers in 
it. What is required to get the pageHeights to calculate correctly? The 
bogus pattern always seen is lines 1 to n-1 of the pageHeights will 
have the same number, and line n will have a different number.

For example, unrelated to the printing problem above, I create a new 
field in the IDE, named "test". In the message box:

   set the text of fld "test" to the script of this stack
   put the pageHeights of fld "test"

182
182
... (cut many lines)
182
56

Why is 182 repeated n-1 times?

I've also tried setting the field's margins to 6 and borderwidth to 0 
as mentioned in the transcript dictionary entry for pageHeights but 
still see the problem.

Alex Rice, Software Developer
Architectural Research Consultants, Inc.
http://ARCplanning.com




More information about the use-livecode mailing list