Skip to content

How to copy text from preview to clipboard

Q: The Windows previewers that are used by DataFlex Reports do not have a text selection option. Is there a way to copy text from the previewer to the clipboard?

A: The OnReportPreviewClick event could be used for that. Here is a sample code:

Procedure OnReportPreviewClick C_DRHitTests iPos Integer iSectionId String sObject String sValue
   Integer iChannel
   Move (Seq_New_Channel ()) to iChannel
   If (iChannel >= DF_SEQ_CHANNEL_MIN and iChannel <= DF_SEQ_CHANNEL_MAX) Begin
       Direct_Output channel iChannel "CLIPBOARD:"
       Write channel iChannel sValue
       Close_Output channel iChannel
       Send Seq_Release_Channel iChannel
   End
End_Procedure