spartacus
2nd April 2008, 16:40
Is it possible to add to the contents of a variable in the "initpr"-initialization string. For example:


test=spmhg15001,
initpr=\EE\\\\$test\\plmhg10150\12\13\E&l26a66F\E(10U\E&k0H,


We tried that, but found, that "$test" would not be resolved. Is there an other way?

spartacus
2nd April 2008, 16:56
We would like to add additional information to the datastream which is sent from Baan to a Unix printer.
We don't like to put the additional information in every Baan-Report. We think about using the printer drivers somehow. For example: add a variable to the "initpr"-string. We tried that already, but the variable was't resolved. In the datastream was only the name of the variable, which we add to "initpr", not the content.

Example:
initpr=\EE\\\\$test\\plmhg10150\12\13\E&l26a66F\E(10U\E&k0H,

Off course all proposals are welcome, also if the use an totaly other way to solve the problem.

mark_h
2nd April 2008, 18:59
Did you try ${test}? Just a shot in the dark.

csecgn
2nd April 2008, 21:53
First a question: Why?

Because you are on Unix, I think yes. You can use a type-file to do this.
I don't see a reason why you don't write the init-String in a type file. You only have to place it as the first colomn/row in your report. You can also use two init-strings (the original and the special you need). The init does nothing else then setting some defaults to the printer. If you leave the first \EE (its a reset) in your string, you can overwrite the init with any values you like.

In the type-file use "\033" for Escape (octal, why ever).

echo "\033E\033&l26a66F\033(10U\033&k0H \c" would the same like the init (currently not sure about \c or /c, but it is important at the end of a line!).

hth

Regards
Christof

csecgn
2nd April 2008, 22:13
Seen your second post to late. Hope my first helps anyhow.

Regards
Christof

mark_h
3rd April 2008, 02:49
First a question: Why?

He does not want to have to modify every report on the system. I can not think of a good way to do that.

Markus Schmitz
3rd April 2008, 08:21
Hi Spartacus,

please avoid double postings!!!

Anyway here my idea for the topic:

Configure your printers in Baan to be of type direct, then instead of calling the lp command in the baan printer config, call a unix scripts (lets call it mylp). Now change the printer driver to contain a unique key for example
%mylpkey% and in the mylp script first replace the key with whatever you like (using the sed command) and then call normally the printer command, ie. lp with the result.

This should work, I think.

Regards,
markus

csecgn
3rd April 2008, 10:20
Markus, your idea will work.
We are doing similar things (barcoding, PDF, formular management) the same way. If you don't set the original init (or like Markus suggested use a "special string" for sed as init), you can create a new file with your init, just add the the baan output with cat and send the new file to the printer.

hth

Regards
Christof

spartacus
7th April 2008, 14:25
Thank you all,

we solved the problem in the way Markus suggested. All the more we use already scripts, to handle printerdata.

mark_h: sorry I didn't try the ${test} because we tried already a script! But this is an interessting proposal an I will test it, if I have the possibilty. And sorry about the double postings, I don't remember how that happens.


We did that, because of a special printer-server. This server needs the information from which user/client the report-data ist produced. Now we just send the contens of our "PROCESS_SET_INFO" and put it as first line in the printerdata. The printer-server will remove this additional information, process the rest and send it to the printer.