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.UltraWebGridDocumentExporterdx1.Format = Infragistics.Documents.Report.FileFormat.PDFdx1.DataExportMode = DocumentExport.DataExportMode.DataInGridOnlydx1.TargetPaperSize = Infragistics.Documents.Report.PageSizes.Letterdx1.TargetPaperOrientation = Infragistics.Documents.Report.PageOrientation.Landscapedx1.DownloadName = "ReportName"dx1.ExportMode = Infragistics.WebUI.UltraWebGrid.Exporter.ExportMode.Customdx1.AutoSizeRows = Infragistics.WebUI.Shared.DefaultableBoolean.Truedx1.EnableTheming = Falsedx1.EnableViewState = False
Dim myStream As New System.IO.MemoryStreamdx1.Export(MyGrid, myStream, False)
Hello
I got the same error when I created the UltraWebGridDocumentExporter dynamically but worked fine when I dragged the control from the toolbox. Before doing the export I added the control to the page using
Me.Controls.Add(dx1)
It worked fine after that. That should resolve your issue too.
The problem here is that I am not using it in a webpage. I was trying to create a dynamic PDF for use in a report that gets emailed every day. I am able to do it with the Excel exporter but not the Document exporter.
Thanks
What are you using to create the UltraWebGridDocumentExporter ? Are you using a user control or something ? In any event, you will need to create instances of controls in the OnInit event and then add them to the pages Controls collection. If you are not then you will need to provide me with more information on exactly what you are doing.
Thanks.
I have written a service that fires off at timed intervals to issue a series of reports. What I am doing is taking a dataset and programically creating an ultrawebgrid to format the data. From there, I have been exporting the grid into Excel and emailing the Excel document as an attachment. It is worked well, but in this instance, I need a PDF vs. an Excel document and the document exporter seems to have additional dependencies that the Excel exporter doesn’t.
I think maybe you are missing a reference to an assembly. You need to reference the Infragistics2.Documents.v8.3 for CLR2 and the 3.5 assemblies if you are using CLR3.5. I have got it working on a page as you can see in the attached sample. I would assume it would work in a WebService. I cannot see your code so I am not sure what else could be causing it.
when you carete it dynamically, it has to be added to the page tree so that it has access to the page object in order to Render.
just add it to the control tree. I do it thruogh the grid that is on the page.
myGrid.Controls.Add( myExporter );
but you can do it through Panel control or any other web control.