0
votes

I have multiple RVSystems set up each with there own unit to print one report each. I have a program where the user can select from a list of which ones they want to see.

The problem I'm trying to solve is how to combine the ones the user selects so they don't have to preview/print for each one they choose. I don't want to use a RVProject because they are all code based and I am not using a .rav file at all. Thanks!!!

I have looked at the Nevrona tip #41 which is supposed to address but it uses a RVProject with a .rav file to access the separate reports.

Nick

1
I would suggest to change one of your tags to rave-reports. You might have a better chance to get an answer.Guillem Vicens
Thanks, I appreciate the suggestion and the edit Charles!user2141045

1 Answers

0
votes

WPCubed wPDF can print multiple RAVE report into one PDF file:

http://www.wpcubed.com/manuals/wpdf/index.html?ravereport.htm

Example 2: Render multiple NDR files directly to the PDF file 'c:\rave.pdf'. It uses an open dialog to let you choose the files.

procedure TForm1.Button1Click(Sender: TObject);
var
   OpenDialog: TOpenDialog;
    RvRenderWPDF: TRvRenderWPDF;
    WPPDFPrinter: TWPPDFPrinter;
    FileStream: TFileStream;
    output: string;
    i: Integer;
begin
OpenDialog := TOpenDialog.Create(Self);
OpenDialog.Options := [ofAllowMultiSelect];
RvRenderWPDF := TRvRenderWPDF.Create(Self);
WPPDFPrinter := TWPPDFPrinter.Create(Self);
try
   OpenDialog.Filter := 'NDF Files|*.NDR';
   RvRenderWPDF.PDFPrinter := WPPDFPrinter;
   RvRenderWPDF.Active := TRUE;
   WPPDFPrinter.AutoLaunch := TRUE;
   WPPDFPrinter.CompressStreamMethod := wpCompressFastFlate;
   if OpenDialog.Execute then
   begin
     output := 'dummy';
     WPPDFPrinter.Filename := 'c:\rave.pdf';
     WPPDFPrinter.BeginDoc;
     try
       for i := 0 to OpenDialog.Files.Count - 1 do
       begin
         FileStream := TFileStream.Create(OpenDialog.Files[i], fmOpenRead);
         try
           RvRenderWPDF.PrintRender(FileStream, output);
         finally
           FileStream.Free;
         end;
       end;
     finally
       WPPDFPrinter.EndDoc;
     end;
   end;
finally
   OpenDialog.Free;
   RvRenderWPDF.Free;
   WPPDFPrinter.Free;
end;
end;

Also maybe You can use Gnostice eDocEngine to merge Rave Reports:

http://www.gnostice.com/nl_article.asp?id=247&t=Export_From_Rave_Reports_To_PDF_And_Other_Formats

Programmatic Export From Rave Report Snapshot File In this example, eDocEngine will be used to export a Rave Reports report from an NDR (Rave Report snapshot) file.

Open the IDE and create a VCL forms application. Drop three Rave Reports export interface components (TgtRaveExportInterface) on the form. Drop a PDF engine (TgtPDFEngine), RTF engine (TgtRTFEngine) and XHTML engine (TgtXHTMLEngine) components on the form. Add a button to the form and set this procedure for its click event handler

procedure TForm5.Button2Click(Sender: TObject);
begin
  // Set output engines for the report export components
  gtRaveExportInterface1.Engine := gtPDFEngine1;
  gtRaveExportInterface2.Engine := gtRTFEngine1;
  gtRaveExportInterface3.Engine := gtXHTMLEngine1;

  // Disable output preferences dialog boxes
  gtPDFEngine1.Preferences.ShowSetupDialog := false;
  gtRTFEngine1.Preferences.ShowSetupDialog := false;
  gtXHTMLEngine1.Preferences.ShowSetupDialog := false;

  // Set output file name of the engines
  gtPDFEngine1.FileName := 'eDoc_Rave_Demo.pdf';
  gtRTFEngine1.FileName := 'eDoc_Rave_Demo.rtf';
  gtXHTMLEngine1.FileName := 'eDoc_Rave_Demo.html';

  // Export a Rave Reports snapshot file to PDF, RTF and XHTML
  gtRaveExportInterface1.RenderDocument('eDoc_Rave.ndr');
  gtRaveExportInterface2.RenderDocument('eDoc_Rave.ndr');
  gtRaveExportInterface3.RenderDocument('eDoc_Rave.ndr');
end;