Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Boilerplate: How to....
Message
 
To
12/04/2007 14:13:19
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01214814
Message ID:
01215492
Views:
19
>>Would you create a separate table, say- ContractBoilerplate.DBF, that had one record with one memo field?
>
>... or a cursor, which you populate from the PRG. I would use this latter option, if the text doesn't normally change.


This is the solution that I am going with right now, although there are another handful of workable solutions that have been suggested.

This is my proof-of-concept code (after dipping into HackFox to figure out the TEXTMERGE commands):
* Boilerplate Test - RBB 12 Apr 2007
LOCAL lcBoiler1, lcBoiler2

SET TEXTMERGE TO MEMVAR lcBoiler1
SET TEXTMERGE ON NOSHOW
\\This is a test of adding a slug of text to 
\\a memory variable that will be REPLACEd into a memo field 
\\of a temporary cursor.  This is a test of adding a 
\\slug of text to a memory variable that will 
\\be REPLACEd into a memo field of a temporary cursor.  This 
\\is a test of adding a slug of text to a memory variable 
\\ that will be REPLACEd into a memo field of a temporary 
\\cursor.  This is a test of adding a slug of text to a 
\\memory variable that will be REPLACEd into a memo field of 
\\a temporary cursor.  This is a test of adding a slug of 
\\text to a memory variable that will be REPLACEd into a 
\\memo field of a temporary cursor.  This is a test of 
\\adding a slug of text to a memory variable that will be 
\\REPLACEd into a memo field of a temporary cursor.  This is 
\\the end of the test text block.
SET TEXTMERGE OFF
SET TEXTMERGE TO

SET TEXTMERGE TO MEMVAR lcBoiler2
SET TEXTMERGE ON NOSHOW
\\Lorem ipsum dolor sit amet, consectetur adipisicing elit,
\\ sed do eiusmod tempor incididunt ut labore et dolore
\\ magna aliqua.  Ut enim ad minim veniam, quis nostrud
\\ exercitation ullamco laboris nisi ut aliquip ex ea
\\ commodo consequat.  Duis aute irure dolor in
\\ reprehenderit in voluptate velit esse cillum dolore eu
\\ fugiat nulla pariatur.  Excepteur sint occaecat cupidatat
\\ non proident, sunt in culpa qui officia deserunt mollit
\\ anim id est laborum.
\\  Lorem ipsum dolor sit amet, consectetur adipisicing elit,
\\ sed do eiusmod tempor incididunt ut labore et dolore
\\ magna aliqua.  Ut enim ad minim veniam, quis nostrud
\\ exercitation ullamco laboris nisi ut aliquip ex ea
\\ commodo consequat.  Duis aute irure dolor in
\\ reprehenderit in voluptate velit esse cillum dolore eu
\\ fugiat nulla pariatur.  Excepteur sint occaecat cupidatat
\\ non proident, sunt in culpa qui officia deserunt mollit
\\ anim id est laborum.
\Lorem ipsum dolor sit amet, consectetur adipisicing elit,
\\ sed do eiusmod tempor incididunt ut labore et dolore
\\ magna aliqua.  Ut enim ad minim veniam, quis nostrud
\\ exercitation ullamco laboris nisi ut aliquip ex ea
\\ commodo consequat.  Duis aute irure dolor in
\\ reprehenderit in voluptate velit esse cillum dolore eu
\\ fugiat nulla pariatur.  Excepteur sint occaecat cupidatat
\\ non proident, sunt in culpa qui officia deserunt mollit
\\ anim id est laborum.  
SET TEXTMERGE OFF
SET TEXTMERGE TO

CREATE CURSOR boilerplate (pgraph1 M, pgraph2 M)
INSERT INTO boilerplate ;
	(pgraph1, pgraph2) ;
VALUES ;
	(lcBoiler1, lcBoiler2)

SELECT boilerplate
*MODIFY REPORT boilertest
REPORT FORM boilertest  TO PRINTER  PROMPT  PREVIEW
USE
RETURN
I'll leave it as an exercise for the reader to create BoilerTest.FRX. :-)

In working through this, I found that I might be able to skip the cursor, as the expression of a report field can be a memvar as well as a table field.

Many thanks to all.
Randy Bosma
VFP - Because life is too short to code in something else...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform