Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I simulate a stretching field in the footer band
Message
From
31/07/1999 03:47:48
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00248362
Message ID:
00248504
Views:
14
>OK, normally the answer is no...
>
>Anybody have any work arounds?
>
>I'm printing a statement with multiple line items and I want to have a variable note show up on the very bottom of the invoice.
>
>I thought of using MLINE() to allow up to, say 5 lines, but then I have to restrict myself to using a fixed pitch font, don't I?
>
>Ideas Appreciated!
>
>Thanx,
>Joe
Hi Joe,
Is this "pessimistic buffering" ? <g>
You don't have to use fixed pitch. With a proprtional font you would hav emore space. You could calculate your linewidths. Below is partial code I use to calculate column widths for word tables :
#DEFINE nTwipsPerInch  1440
lnPixelsPerInch = _GetPixelsPerInch(0) && 0 Horizontal
lnSizeInPixels = txtwidth(lcSampleText, lcFont, lnFontSize) * fontmetric(6, lcFont, lnFontSize)
lnPoints = ( lnSizeInPixels  / lnPixelsPerInch * nTwipsPerInch ) / 20
* 1 Twip = 1/20 point, 567 twips 1 cm

FUNCTION _GetPixelsPerInch
LPARAMETERS lnDirection
DECLARE INTEGER ReleaseDC IN Win32Api;
	INTEGER nwnd, INTEGER hdc
DECLARE INTEGER GetDeviceCaps IN Win32API;
	INTEGER hdc, INTEGER nIndex
DECLARE INTEGER GetWindowDC IN Win32API;
	INTEGER hWnd

#DEFINE WU_LOGPIXELSX  88
#DEFINE WU_LOGPIXELSY 90
lnDC = GetWindowDC(0)
IF (lnDirection = 0)       &&Horizontal
	lnPixelsPerInch = GetDeviceCaps(lnDC, WU_LOGPIXELSX)
ELSE                       &&Vertical
	lnPixelsPerInch = GetDeviceCaps(lnDC, WU_LOGPIXELSY)
ENDIF
lnDC = ReleaseDC(0, lnDC)
RETURN lnPixelsPerInch
Twips is device independent and fixed to be 1440 per inch. Since you know your page width, you have a chance to precisely calculate text size in cm or inch.

And I have an another idea but didn't test. Instead of a constant height band like footer maybe you could use a strechable one. ie: Detail line comes to mind, checking position as lines print and using print when. Current position would roughyly be the starting position (start of detail) + lineno*lineheight. Good luck.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform