Leave feedback
  • Question

    How to change printer to use based on amount of data to be printed

Enter a new topic
  • Wilson Lim Wilson Lim
    0 likes 23471 views

    We are using streamserve to print out documents in Lawson M3/Movex. We have two page sizes for our delivery receipt print out, half page and full page. Because we are using continuous form paper, we have one printer for the half page and another for the full page format. The printer to be used is hardcoded by Movex in the streamIn file it sends to streamserve. When streamserve is processing this message, I want to be able to change the printer to be used depending on how many data is to be printed. The printer name is stored in the variable $mvx_devicearr[n]. I tried to modify the $mvx_devicearr[n] in the before script of the process but i get this message-"Tried to modify readonly variable: $mvx_devicearr". Is there a way to modify this variable using scripts or does streamserve have a modifiable variable that holds the printer name that the output is assigned to?

    Sunday 28 November, 2010
  • Best Answer
    Andreas Hjelle Andreas Hjelle
    1 likes

    Hi Wilson,

    Here is an article that describes how you override the settings from M3/Movex.

    Regards,

    andreas

     

    Monday 29 November, 2010
  • Andreas Hjelle Andreas Hjelle
    1 likes

    Hi Wilson,

    The movex agent will create variables from meta data delivered in the stream file. All fields with prefixed with asterisk (*) will be treated as a variable: *LANGUAGE = $mvx_language. See this post form more on the subject.

    These variables are Read Only and not possible to modify as your log message states. However, if you run the job again, you can override the variables. The easiest way to do this is to tick off "Select automatically" on the process in Runtime. Then use the AgentDriver() function provided by Lawson with the M3 installation (MOMstandardV2.2.fcn) to call the process again from after message script. Here you can override the $printer variable if you want. Remember to use SetDestPath($outPath) on the process.

    Of course you can also use normal callproc() to call the process. You will then have to script the delivery settings yourself.

    If you have problems with this, please let me know. I can post some screen dumps to explain.

    Regards,

    andreas

    Sunday 28 November, 2010
  • Wilson Lim Wilson Lim
    0 likes

    Thanks for the quick reply Andreas. You wrote that if I run the job again, I can override the variables. If I run the job again, would the document print twice? First on the half page printer and then again on the printer that the printer variable was changed to.

    Also, can I put the script that modifies the printer variable in the blocks in PageOut? Because I plan on using a script that checks if the blocks or frame has used up more than half of the page (by using GetCurrBlockY). The script will then change the printer name to print to if it takes up more than the half page. Please post screen dumps if possible.

    Thanks for your help.

    Regards,

    Wilson

    Monday 29 November, 2010
  • Andreas Hjelle Andreas Hjelle
    0 likes

    Hi,

    Just to avoid misunderstandings: By "run the job again" I mean that you call the process(es) again from inside of StreamServe, not to send it once more from M3. When you turn off auto select on the process it will not execute (i.e. be delivered to any printer or other media) until you specify it by using callproc().

    Output connector and printer has to be set before the process run so you can not decide this when you're inside a block. It might be possible to calculate page size in PreProc phase and based on this switch printer. It is also possible to count lines before you output and send all output with more than n lines to a separate printer (MsgCountId("blockName") will count number of lines before process).

    I'll get some screen dumps for you during the day.

    Regards,

    andreas

    Monday 29 November, 2010
  • Andreas Hjelle Andreas Hjelle
    1 likes

    Hi Wilson,

    Here is an article that describes how you override the settings from M3/Movex.

    Regards,

    andreas

     

    Monday 29 November, 2010
  • Wilson Lim Wilson Lim
    0 likes

    Thanks so much Andreas. I really appreciate you help.

    Cheers,

    Wilson

    Tuesday 30 November, 2010