Version

FileBuffer Property

A filename where data can be cached during a Publish operation.
Syntax
'Declaration
 
Public Property FileBuffer As String
public string FileBuffer {get; set;}
Remarks

Specifies a filename for the file buffer. A filebuffer will only be used if UseFileBuffer is True. The filename specified need not exist on the drive, but if it does, any data in the file will be lost.

Note: If FileBuffer is not specified and UseFileBuffer is True, the UltraGridDocumentExporter will attempt to create a file in the system temp folder. So it is not neccessary to specify a FileBuffer unless there is reason to beleive that the application will not have access to the temp folder.

Example
The following code demonstrates setting some basic properties on the UltraGridDocumentExporter and then exporting a grid to a file.

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);
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also