Hi,
I'm using the UltraWebGridExcelExporter class to export grid data to an Excel file. The problem is that when the grid doesn't have any data, the exporter doesn't export the grid column headers. Is there any approach to export headers when there is no data in the grid?
Thanks.
Hi tynch,I have investigated your scenario and you are completely correct - the exporter does not export the headers when there are no rows in the grid.
As a solution in this situation you can use create an Infragistics.Documents.Excel.Workbook object, which will allow you to generate the worksheet(s) of your exported file in the way you desire (including displaying the headers of an empty grid by setting the first row in a worksheet). A detailed article illustrating how the Workbook is used can be found at:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=9981
Alternatively, you can use our WebDataGrid control in conjunction with the WebExcelExporter. Given again, that the grid is bound to a data source, the WebExcelExporter will export the headers when there are no rows in the grid.
You can find more information about the exporter in our documentation at:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1/CLR4.0/?page=Web_WebExcelExporter.html
Please contact me if you have any questions.Best Regards,Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://ko.infragistics.com/support