merge

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

merge

Postby barsyr » Thu May 05, 2011 2:11 pm

Hi,
I have one developpers-license of VPE 5 (vpep32).
I’m looking for the following solution : I would like to make a VPE-document with standard text. Then add text by code at a specific position, or even better in a field that is in the document. I.e. I want to make a standard document, and print that same document 100 times but always with another name on it (like a mailmerge).
Do I need Dycodoc for this or can this be done in vpep32 – VPE 5.
I’ve been looking on the website, and I see that dycodoc includes VPE 6. When I’m in need of Dycodoc (I hope not), does this mean that all my customers must upgrade to the runtime VPE 6 ? What is the pricing of dycodoc ?

Kind Regards
barsyr
 
Posts: 1
Joined: Thu May 05, 2011 2:07 pm

Re: merge

Postby IDEAL Software Support » Fri May 06, 2011 8:26 am

This can be solved easily.

Step 1:
Create your basic VPE document and write it to a file, using Vpe.WriteDoc("<filename>.vpe")

The suffix ".vpe" for the file name is important. By specifying different suffixes, different file formats are created, for example ".pdf", ".xml" or ".odt". The ".vpe" file format is the native file format of VPE. VPE can read and write this file format.

Step 2:
In order to add additional text objects or other objects later to the basic document, create a blank document and read the file into the new blank document:
Vpe.OpenDoc()
Vpe.ReadDoc("<filename>.vpe")
... add additional objects to the document here ...
IDEAL Software Support
 
Posts: 1622
Joined: Thu Nov 18, 2004 4:03 pm

Re: merge

Postby DDTech » Tue Nov 01, 2011 12:19 pm

barsyr wrote:... I.e. I want to make a standard document, and print that same document 100 times but always with another name on it (like a mailmerge).


How about using an RTF-Document with placeholders like
Code: Select all
<<FirstName>> <<LastName>>
..

Dear <<Salutation>>,

we like to inform You that a new Version of VPE has just been released and is available .....



where FirstName, LastName and Salutations are Fieldnames or available variables.

You could then load this RTF-doc into memory, replace the tokens with Your Information while You scan through Your dataset and oVPE.WriteRTF() the resulting text.
In VFP I can use the textMerge() function in order to replace the tokens with data, but I'm sure something like this exists in most other languages as well.


Regards

Frank
DDTech
 
Posts: 37
Joined: Mon Oct 26, 2009 11:45 am


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 68 guests