Copy text to clipboard from preview

edited 8:40AM in FastReport 4.0
We are using the VLC for Delphi 2010 demo version and we are thinking about buying your components. But still there are some problems that we have to resolve, the major problem is how to let the user copy text from the report preview.
Is that implemented in your component or do you know a simple way of implementig it?

thx, Jan

Comments

  • gpigpi
    edited 8:40AM
    procedure TForm1.frxReport1ClickObject(Sender: TfrxView;
      Button: TMouseButton; Shift: TShiftState; var Modified: Boolean);
    var MyClipboardFormat: Word;
        MyHandle: Cardinal;
        MyPalette: HPalette;
    begin
         if Sender is TfrxPictureView then
           if Sender.Name = 'Picture1' then
             begin
               MyClipboardFormat := CF_BITMAP;
               TfrxPictureView(Sender).Picture.SaveToClipboardFormat(MyClipboardFormat, MyHandle, MyPalette );
               ClipBoard.SetAsHandle(MyClipboardFormat, MyHandle);
             end;
    end;
    
  • edited 8:40AM
    i have found that solution before, i was hoping that there is a way to let the end-user, hightlight text in the preview and copy the highlighted text, not just the clicked object...
  • gpigpi
    edited 8:40AM
    There are no such solution
  • edited January 2012
    Export and display the report as PDF and copy, paste and print from there works.
  • edited 8:40AM
    Hello,

    is it possible to copy a whole Text of an Memo-Field to the Clipboard?

    thx a lot!
  • gpigpi
    edited 8:40AM
    wrote:
    is it possible to copy a whole Text of an Memo-Field to the Clipboard?
    No
  • edited 8:40AM
    Okay > , thank you for answer!>
  • The answer is Yes, I did it, use a TMemoryStream.
    Here is the code I used:
    frxSimpleTextExport1.ShowDialog := false;
    aStream := TMemoryStream.Create
     try
      frxSimpleTextExport1.Stream := aStream;
      frxReport1.Export(frxSimpleTextExport1);
      aStream.Position := 0;
      Memo1.Lines.LoadFromStream(aStream);
      Memo1.SelectAll;
      Memo1.CopyToClipboard;
     finally
      frxSimpleTextExport1.Stream := nil;
      FreeAndNil(aStream);
     end;
    
  • edited 8:40AM
    I agree with the second comment about that ....

Leave a Comment