IPeople Blog

Use NPR Report to write to the Windows Clipboard (MAGIC)

Written by Gary | Apr 18, 2022 5:00:00 AM

You can modify your report so that everything that prints is sent to your Windows clipboard.  This is of course only possible for reports running on the Meditech Remote Workstation.  Also, it is not possible for reports printed to a Spool file.

The Meditech Remote Workstation responds to the D(30)_"CB" by storing all subsequent data sent to the Workstation in the Windows clipboard.  The D(0) command instructs the Workstation to stop storing data in the Windows clipboard.

D is called the Decode function in the Meditech programming language.  It creates the ASCII character associated with the code provided in parentheses. 

Here are the steps:

  1. Add the following Footnotes:
    AL START "DPM.zcus.report.M.print"^/R.TRANS
    AL CLOSE.UP close.up
  2. Replace 'DPM' with your Report DPM and 'report' with the name of your report.
  3. File and translate your report.
  4. Create a macro called 'close.up' with the following code, then file and translate it:
    IF{@Not(@.pc);
        @Z.spool;
        @Not(+/TEXT[""]);
        /R.HALTED;
        @Not(@Z.rpt.found);
        D(30)_"CB"^#,
        ""^TEMP,
        DO{+/TEXT[TEMP]^TEMP /TEXT[TEMP]_@Z.cr.lf^#,
                                              ""^/TEXT[TEMP]},
        D(0)^#}
  5. Create a macro called 'print' with the following code, then file and translate it:
    /R.OUT:0X^/TEXT[-/TEXT[""]+1],
     /R.OUT^!;
  6. Retranslate your report.