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
145
UltraGridExcelExporter export Issue
posted

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

  • 48586
    Verified Answer
    posted

    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.  

    135290.zip
  • 469350
    Offline posted

    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.

  • 48586
    posted

    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.