'宣言 Public Property TargetPaperOrientation As Infragistics.Documents.Reports.Report.PageOrientation
public Infragistics.Documents.Reports.Report.PageOrientation TargetPaperOrientation {get; set;}
これはドキュメントのページのアスペクト比を保持するために使用されます。エクスポートする場合、DocumentExporter は 1 ページにすべてのグリッド列を収めるために必要なページの幅を決定します。これが TargetPaperSize よりも広い場合、ページ幅と高さは比率を保持して増加し、TargetPaperSizeまたは TargetPaperOrientation に基づきページのアスペクト比を保持します。これは、ドキュメントが印刷され、ページにスケール ダウンされる時、ページ領域の最大数が使用されることを意味します。
Imports Infragistics.Documents.Report Imports Infragistics.Win.UltraWinGrid.DocumentExport ' AutoSize the grid columns and rows when exporting Me.ultraGridDocumentExporter1.AutoSize = Infragistics.Win.UltraWinGrid.DocumentExport.AutoSize.SizeColumnsAndRowsToContent ' Use a file buffer Me.ultraGridDocumentExporter1.UseFileBuffer = True ' Specify a file instead of letting the control use the temp folder. Dim bufferFileName As String = Path.Combine(Application.StartupPath, "ExportFileBuffer.tmp") Me.ultraGridDocumentExporter1.FileBuffer = bufferFileName ' Set the target paper orientation, size, and margins Me.ultraGridDocumentExporter1.TargetPaperOrientation = PageOrientation.Portrait Me.ultraGridDocumentExporter1.TargetPaperSize = PageSizes.Legal Me.ultraGridDocumentExporter1.TargetPaperMargins = PageMargins.Normal ' Export the grid to a PDF file. Dim exportFileName As String = Path.Combine(Application.StartupPath, "grid.pdf") Me.ultraGridDocumentExporter1.Export(Me.ultraGrid1, exportFileName, GridExportFileFormat.PDF) ' Launch the exported file in the appropriate reader. Process.Start(exportFileName)
using Infragistics.Documents.Report; using Infragistics.Win.UltraWinGrid.DocumentExport; // AutoSize the grid columns and rows when exporting this.ultraGridDocumentExporter1.AutoSize = Infragistics.Win.UltraWinGrid.DocumentExport.AutoSize.SizeColumnsAndRowsToContent; // Use a file buffer this.ultraGridDocumentExporter1.UseFileBuffer = true; // Specify a file instead of letting the control use the temp folder. string bufferFileName = Path.Combine(Application.StartupPath, "ExportFileBuffer.tmp"); this.ultraGridDocumentExporter1.FileBuffer = bufferFileName; // Set the target paper orientation, size, and margins this.ultraGridDocumentExporter1.TargetPaperOrientation = PageOrientation.Portrait; this.ultraGridDocumentExporter1.TargetPaperSize = PageSizes.Legal; this.ultraGridDocumentExporter1.TargetPaperMargins = PageMargins.Normal; // Export the grid to a PDF file. string exportFileName = Path.Combine(Application.StartupPath, "grid.pdf"); this.ultraGridDocumentExporter1.Export(this.ultraGrid1, exportFileName, GridExportFileFormat.PDF); // Launch the exported file in the appropriate reader. Process.Start(exportFileName);