[英]Rave Reports Merging
我有多個RVSystem,每個系統都有自己的單元,每個單元可以打印一份報告。 我有一個程序,用戶可以從列表中選擇要查看的程序。
我要解決的問題是如何合並用戶選擇的內容,這樣他們就不必為選擇的每個對象進行預覽/打印。 我不想使用RVProject,因為它們都是基於代碼的,而且我根本不使用.rav文件。 謝謝!!!
我看了應該解決的Nevrona提示#41,但它使用了帶有.rav文件的RVProject來訪問單獨的報告。
缺口
WPCubed wPDF可以將多個RAVE報告打印到一個PDF文件中:
http://www.wpcubed.com/manuals/wpdf/index.html?ravereport.htm
示例2:直接將多個NDR文件渲染到PDF文件“ c:\\ rave.pdf”。 它使用打開的對話框讓您選擇文件。
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;
另外,也許您可以使用Gnostice eDocEngine合並Rave報告:
http://www.gnostice.com/nl_article.asp?id=247&t=Export_From_Rave_Reports_To_PDF_And_Other_Formats
從Rave報告快照文件以編程方式導出在此示例中,將使用eDocEngine從NDR(Rave報告快照)文件導出Rave Reports報告。
打開IDE並創建一個VCL表單應用程序。 將三個Rave Reports導出接口組件(TgtRaveExportInterface)放在窗體上。 在表單上放置PDF引擎(TgtPDFEngine),RTF引擎(TgtRTFEngine)和XHTML引擎(TgtXHTMLEngine)組件。 將一個按鈕添加到窗體,並為其單擊事件處理程序設置此過程
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;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.