April 18, 2022

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

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.

Topics: MEDITECH, Magic NPR, NPR Report

You Might Also Enjoy

The Footnote FD (Field Delimiter) requires you to enter the ASCII code for a keystroke. ...

Steps: Select the Report DPM NPR.DOLT Enter a report name (any name you like) Page 1 will ...

You can use the following steps to write data to your Windows clipboard from an NPR ...

Select the Report DPM NPR.PROC Enter a report name (any name you like) Page 1 will need a ...

NPR.SEG.id.editor is a very useful routine in MEDITECH's C/S software that provides handy ...