Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to print a string at the specific line number?
Message
From
20/07/1998 11:41:43
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
To
16/07/1998 12:12:01
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00118022
Message ID:
00119275
Views:
19
>
>Can you give an example?
>
>Thanks.
>

OK,

Create a program called LineCnt.prg

IF TYPE('gnCount') <> 'N'
PUBLIC gnCount
gnCount = 1
ELSE
gnCount = gnCount + 1
ENDIF
RETURN SPACE(0)

Create a program called ResetCnt.prg

IF TYPE('gnCount') <> 'N'
PUBLIC gnCount
ENDIF
gnCount = 0
RETURN SPACE(0)

In your report, in the page header add a field with the expression
ResetCnt()

In the detail band of the report, add a field with the expression
LineCnt()

Also in the detail band, add a field containing the data that you want to print, say only on line 20. Click on the 'PrintWhen' option for this field, then 'Print only when expression is true'. Add the following expression:
TYPE('gnCount') = 'N' AND gnCount = 20

I've used a lot of TYPE checking just as a safeguard.

When your report is finished, you should also
RELEASE gnCount
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Previous
Reply
Map
View

Click here to load this message in the networking platform