ASPxGridBase.ExportToPdf(Stream, PdfExportOptions) Method
In This Article
Exports the control’s data to the specified stream in PDF format using the specified options.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
public void ExportToPdf(
Stream stream,
PdfExportOptions exportOptions
)
#Parameters
Name | Type | Description |
---|---|---|
stream | Stream | A Stream object, to which the created document is exported. |
export |
Pdf |
A Pdf |
#Remarks
This method indirectly calls the PrintingSystemBase.ExportToPdf method of the XtraPrinting Library. If this library is not available the method does nothing. For details on the ExportToPdf method, see the PrintingSystemBase.ExportToPdf topic.
#Example
protected void ASPxButton1_Click(object sender, EventArgs e)
{
PdfExportOptions options = new PdfExportOptions();
options.Compressed = false;
using (System.IO.FileStream output = new System.IO.FileStream(@"F:\MyOutput.pdf", FileMode.Create)) {
ASPxGridView1.ExportToPdf(output, options);
}
}
See Also