Hi,
Im trying to export data from my grid to the excel using UltraGridExcelExporter.
below is my code and the datagrid has data in it, but at the line "Me.UltraGridExcelExporter1.Export(Me.grdViewEdit, myStream)", Im getting the "Object reference not set to an instance of an object." error.
Can anyone please help?
Code:
Private Sub UltraButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click Dim myStream As String Dim saveFileDialog1 As New SaveFileDialog() saveFileDialog1.Filter = "Excel Files (*.xls)|*.xls" saveFileDialog1.FilterIndex = 2 saveFileDialog1.RestoreDirectory = True If saveFileDialog1.ShowDialog() = DialogResult.OK Then myStream = saveFileDialog1.FileName() Me.UltraGridExcelExporter1.Export(Me.grdViewEdit, myStream) End If End Sub
Hello ,
I’ve tried your code with Infragistics 13.2 and everything works properly on my machine. also I’ve modified your code a little in order to generate log message which might be helpful for narrowing the issue. Please test my sample and let me know if it works for you. Also please let me know which exactly version of Infragistics you are using, if it is possible please modify my sample in order to demonstrates your issue.
I am waiting for your feedback.
My guess is that this exception is occurring in your code, probably in an event handler of one of the grid's events. It might help if you posted the entire call stack, or set Visual Studio to break on all exceptions so you can see the actual line of code on which the exception occurs.
Hello,
I am just checking about the progress of this issue. Let me know If you need my further assistance on this issue?
Thank you for using Infragistics Components.