Search code examples
delphirave-reports

Delphi - preview a Rave report on the form


How can I preview a rave report on a Delphi form? I have a page control with 2 pages: on the first one the user enter some data (name, address...) and I want on the second page to preview the report generated with the data from the first page.


Solution

  • You can render a preview to any TScrollBox with a TRvRenderPreview:

    With a TRvSystem:

       RvRenderPreview1.ScrollBox := ScrollBox1; // a scrollbox on a TTabSheet
    
       RvSystem1.DefaultDest := rdFile;
       RvSystem1.SystemSetups := RvSystem1.SystemSetups - [ssAllowSetup];
    
       RvSystem1.RenderObject := RvRenderPreview1;
       RvSystem1.DoNativeOutput := false;
    
       RvSystem1.Execute;