Copy text to clipboard from preview

edited 3:12PM 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 3:12PM
    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 3:12PM
    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 3:12PM
    There are no such solution
  • edited January 2012
    Export and display the report as PDF and copy, paste and print from there works.
  • edited 3:12PM
    Hello,

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

    thx a lot!
  • gpigpi
    edited 3:12PM
    wrote:
    is it possible to copy a whole Text of an Memo-Field to the Clipboard?
    No
  • edited 3:12PM
    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 3:12PM
    I agree with the second comment about that ....

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.