' 新しいページレポートを作成します。 Dim _reportDef As New GrapeCity.ActiveReports.PageReport(New System.IO.FileInfo(Server.MapPath("") + "\PageReport1.rdlx")) Dim reportDocument As New GrapeCity.ActiveReports.Document.PageDocument(_reportDef) ' PDFファイル出力用の情報を設定します。 Dim exportFile1 As String = Server.MapPath("") + "\PDF\" + System.IO.Path.GetRandomFileName + ".pdf" Dim myFile1 As New System.IO.FileInfo(exportFile1) Dim settings As New GrapeCity.ActiveReports.Export.Pdf.Page.Settings() settings = New GrapeCity.ActiveReports.Export.Pdf.Page.Settings() settings.DocumentToAddBeforeReport = exportFile1 'DocumentToAddAfterReportプロパティ。 ' 描画拡張機能を設定し、レポートを読み込みます。 Dim pdfRenderingExtension As New GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension() Dim _outputProvider As New GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(myFile1.Directory, System.IO.Path.GetFileNameWithoutExtension(myFile1.Name)) reportDocument.Render(pdfRenderingExtension, _outputProvider, settings)
// 新しいページレポートを作成します。 GrapeCity.ActiveReports.PageReport _reportDef = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath("") + "\\PageReport1.rdlx")); GrapeCity.ActiveReports.Document.PageDocument reportDocument = new GrapeCity.ActiveReports.Document.PageDocument(_reportDef); // PDFファイル出力用の情報を設定します。 string exportFile1 = Server.MapPath("") + "\\PDF\\" + System.IO.Path.GetRandomFileName + ".pdf"; System.IO.FileInfo myFile1 = new System.IO.FileInfo(exportFile1); GrapeCity.ActiveReports.Export.Pdf.Page.Settings settings = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings(); settings = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings(); settings.DocumentToAddBeforeReport = exportFile1; //DocumentToAddAfterReportプロパティ。 // 描画拡張機能を設定し、レポートを読み込みます。 GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension pdfRenderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension(); GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider _outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(myFile1.Directory, System.IO.Path.GetFileNameWithoutExtension(myFile1.Name)); reportDocument.Render(pdfRenderingExtension, _outputProvider, settings);