IPeople Blog

Use NPR Report to write to the Windows Clipboard (MEDITECH CS)

Written by Gary | Feb 28, 2022 6:00:00 AM

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

  1. Add the following Footnotes:
    AL START start
    AL D detail
    AL CLOSE.UP close.up

  2. File and translate your report.
  3. Add a macro called start with the following code, then file and translate.
    @Memory.allocate("")^MEM,
    @Memory.beginning(MEM)
  4. Add a macro called close.up with the following code, then file and translate.
    @Clipboard.load(MEM),
    @Memory.clear(MEM),
    @Memory.free(MEM)
  5. Add a macro called detail with the following code:
    DATA_@Z.cr.lf^DATA,
    @Memory.write(MEM,DATA)

    You can replace DATA with whatever you like.  You can use the NPR macro called @Memory.write to write whatever data you like to the memory buffer.  So you are not limited to just doing this in a detail macro.  The start macro creates the memory buffer and the close.up macro copies it to your Windows clipboard.
  6. Retranslate your report.