Source language: Translate to:

Using variable in text to print

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Using variable in text to print

Postby BRobinsonS » Mon May 01, 2017 6:20 am

I have an app to create and edit different custom letters.
The text is stored in a DBPro table and printed using Report Designer.

The header is the same but text varies.

The text is plain text but I want to use variable(s) in the text to personalize the text.
Is there a way to do this Report Designer?
Brian Robinson
'When all else fails, try again!'
www.ComputerSoftwareSystems.com
User avatar
BRobinsonS
 
Posts: 337
Joined: Sun Sep 25, 2005 9:00 pm
Location: Ontario, Canada

Re: Using variable in text to print

Postby Gaev » Mon May 01, 2017 7:45 am

Brian:

I have an app to create and edit different custom letters.
The text is stored in a DBPro table and printed using Report Designer.

The text is plain text but I want to use variable(s) in the text to personalize the text.
Is there a way to do this Report Designer?

Have you looked at the PopulateStr command ... one of NeoBook's hidden gems.

With it, you can define a plain text file as a kind of "Template" (with interspersed Text and NeoBook Variables) ... then issue this command to ...

- read this Template file
- replace all NeoBook Variables with their current values
- store the result in a specified variable

in your case, you could do a FileWrite of your "custom letter template stored in DBPro Table record" before issuing this command ... and then another FileWrite of the result of the PopulateStr command ... and finally, use PrintTextFile or PrintdataFile to print the content.
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Using variable in text to print

Postby BRobinsonS » Mon May 01, 2017 9:05 am

Thanks for the tip.
I'll work on that.
Brian Robinson
'When all else fails, try again!'
www.ComputerSoftwareSystems.com
User avatar
BRobinsonS
 
Posts: 337
Joined: Sun Sep 25, 2005 9:00 pm
Location: Ontario, Canada


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 5 guests