Guy Algot | 17 May 06:11

Re: Printing page 1 of X

I didn't think so.

I've been using Justin's PRINT FORM code from Summit. Good stuff...  
But I solved my original problem. Not sure why the difference but I  
was able to get it to work by executing the entire print method twice  
vs looping inside it twice. So this works;

vL_TotalPages:=0
vB_BreakNormal:=False

SET PRINT OPTION(Hide printing progress option ;1)
Quotes_PrintShippingForm

vB_BreakNormal:=True

SET PRINT OPTION(Hide printing progress option ;0)
Quotes_PrintShippingForm

Whereas before I was looping twice inside the  
Quotes_PrintShippingForm method. Thanks for the reply.

On May 16, 2008, at 2:21 AM, Arnaud de Montard wrote:

>
> Le 16 mai 08 à 03:59, Guy Algot a écrit :
>
>> I was hoping to not go thru what you have done to get it to work.  
>> Print the form, get the #, cancel it, then print for real. Never  
>> as easy as it seems. ;-)
>>
>> So if you suppress the PRINT FORM, how are you getting the height  
>> of each section?
>
> You can't: only the form "knows" the objects (markers, fields and  
> so on), and only its method form can read positions, resize them,  
> and accept or not printing with CANCEL.
>
> I use a wrapper of PRINT FORM, something like this:
>   wrapPrintForm (->table;form{;printMarker{;maxHeight{;truncHeight)  
> -> height of printed section
> when I pass $4 maxHeight =0, wrapPrintForm calculates but does not  
> print. I use 4 process variables to send and receive params between  
> wrapper and method form (pseudo params), as below.
>
>   `method form
> ...
>   `read pseudo params from process var:
> $lMarker:=vl_printMarker  `$3 in wrapPrintForm
> $lmaxHeight:=vl_maxHeight  `$4 in wrapPrintForm
>   `read form objects
> $lPosMarker:=Get print marker($lMarker)
> $lPosPreviousMarker:=getPosPreviousMarker($lMarker)
> $lBeforeResize:=$lPosMarker-$lPosPreviousMarker
> Case of
> 	: ($lMarker=Form Detail )
> 		$lRedim:=...wrap_BEST_OBJECT_SIZE(->Object)...
> 		$lNewPosMarker:=$lPosMarker+$lRedim
> 		If (($lBeforeResize+$lRedim)>$lmaxHeight)  `too much
> 			CANCEL
> 		Else   `print
> 			`do SET PRINT MARKER and MOVE OBJECT
> 		End if
> End case
> vlPrintedHeight:=$lRedim+$lBeforeResize  `$0 in wrapPrintForm
>
>
> as you said, never as easy as it seems. ;-)
>
> -- 
> Arnaud de Montard
>

Later,
Guy

**********************************************************************
The 4D v11 SQL Roadshow - coming to a city near you!
http://www.4D.com/roadshow/index.html

4th Dimension Internet Users Group (4D iNUG)
FAQ:  http://www.4d.com/support/faqnug.html
Archive:  http://dir.gmane.org/gmane.comp.lang.inug-4d.tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
Post: mailto:4d_tech@...
Options: https://lists.4d.com/mailman/listinfo/4d_tech
**********************************************************************


Gmane