PDA

View Full Version : Printing a document that has variables


cchian
10-25-2003, 06:12 PM
I am trying to simplify a project so most or all info that changes comes from INI files. I have a set of installation instructions for different products, the only thing that is different is the product name and the recommended product path. I can read those values from INI files and they will display correctly inside a text box, but when you print the file the name of the variable will print instead of its value. Is there any way to accomplish this? This wasn't possible back in AMS3 (see http://www.indigorose.com/forums/showthread.php?s=&threadid=417). It does not have to be confined to text files or text boxes.

If it shows correctly in a text box, there must be a way to somehow copy this into a temp file and then display or print this file.

Corey
10-25-2003, 06:35 PM
Easiest way is to write it to an HTML file using a TEXT FILE > WRITE action and then printing the web page...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

JimS
10-25-2003, 06:50 PM
Here is a sample project that will do what you want. That is if I understand you correctly. Give it a try.

Corey
10-25-2003, 06:56 PM
Yes there are others ways to print, nice project JimS. But if you print that way you have no real control over formatting. So this is good if you don't need to control the typical print stuff such as adding a logo, the layout of your page, i.e. text formatting, colors, tables, etc... If you need to control those things writing an HTML file might work better...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

cchian
10-25-2003, 07:18 PM
JimS, lets say my text file is 1-2 pages long and the only thing that needs to change is a word somewhere at the begining and another word somewhere close to the end. Is there a way to do this? I was thinking to have %variable1% and %variable2% somewhere in the document. Using your example seems I would have to have the complete text and variables listed in the TEXT FILE > WRITE. Is this correct?

Corey, I will explore your suggestion, too.

JimS
10-25-2003, 07:47 PM
Sure Corey, I just didn’t get into it that much. I agree that creating an HTML file let’s you do all kinds of additional things. I thought his problem was getting the value of the variable to print, instead of the name of the variable. i.e. Jim as opposed to %FirstName%

I figured that the more complex my answer (project) was, the harder it would be to follow. I guess I misunderstood the question. If he wants to print out a pretty page for the user to have, then I’d definitely go the HTML route. Maybe something like this:

JimS
10-25-2003, 07:50 PM
Somehow I lost the sample project on the last post, try this:

cchian
10-25-2003, 08:58 PM
Thanks for the examples, that was exactly what I was looking for. It gave me some new ideas, too. :)

Carlos