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
40
Excel Export
posted

Hi,

Does anyone see any problems with the following code?

Dim exporter As UltraGridExcelExporter = New UltraGridExcelExporter()

Dim tempGrid As UltraGrid = New UltraGrid()

tempGrid.DataSource = dataTable

tempGrid.DataBind()

exporter.Export(tempGrid, fileName)

My dataTable has rows and is correctly configured. The issue is that all I get after the export is an empty file. The DataBind call has no affect.

Thank you,

Rick

 

Parents
No Data
Reply
  • 811
    Verified Answer
    posted

    Rick,

    I have seen one major issue with your code that grid is not added as Control on Form, that is why you are not getting any rows in exported excel file, what you need to do is just use the following code to add Grid on Form as control:       

     Me.Controls.Add(tempGrid)

    and it will work for you i.e. excel will contain rows from datatable.

    Thank you.

    Bunty :)

Children