Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
PDF Export created programatically throwing error
posted

Hello,

I have a program where I create an UltraWebGridDocumentExporter programatically and it throws an "object reference not set to an instance of an object error" on export.  I believe that there is a poperty that doesn't get filled in if the document exporter isn't created via an aspx page?  Does anyone know what it may be.

Thanks, Example below

Dim dx1 As New Infragistics.WebUI.UltraWebGrid.DocumentExport.UltraWebGridDocumentExporter
dx1.Format = Infragistics.Documents.Report.FileFormat.PDF
dx1.DataExportMode = DocumentExport.DataExportMode.DataInGridOnly
dx1.TargetPaperSize = Infragistics.Documents.Report.PageSizes.Letter
dx1.TargetPaperOrientation = Infragistics.Documents.Report.PageOrientation.Landscape
dx1.DownloadName = "ReportName"
dx1.ExportMode = Infragistics.WebUI.UltraWebGrid.Exporter.ExportMode.Custom
dx1.AutoSizeRows = Infragistics.WebUI.Shared.DefaultableBoolean.True
dx1.EnableTheming = False
dx1.EnableViewState = False

Dim myStream As New System.IO.MemoryStream
dx1.Export(MyGrid, myStream, False)

Parents Reply Children