Hello Infragistics Support,
I have taken over an ASP.NET web project for an application which exports data from a SQL Server to Excel Spreadsheets using Infragistics for ASP.Net.
The technique which is currently used is that GridViews are bound to theSQL Data Source (sourced from a stored procedure). The content of the GridViews is then exported to an Infragistics.Excel.Worksheet.
Here a short extract of the code:
Infragistics.Excel.Workbook exportWB = new Infragistics.Excel.Workbook(); //creates workbook Infragistics.Excel.Worksheet CRWrks = exportWB.Worksheets.Add("CR"); //creates worksheetthis.UltraWebGridExcelExporter1.Export(GridView_CR, CRWrks); //Export of GrdiView data to worksheet....
//the download part of the web applicationGuid guid = Guid.NewGuid();string exportFileName = "DataExport_" + guid.ToString();UltraWebGridExcelExporter1.DownloadName = exportFileName;exportWB.Save(Server.MapPath(@"..\Exports") + @"\" + exportFileName);....
The Spreadsheet is sent to the client browser without problems andthe data are filled into the worksheets, however the problem we have can be described as follows:
The data in the SQL database GridView contain dates in the format "DD/MM/YYYY".The user wishes to sort the data in the Spreadsheet by date chronologically.The exported Excel Spreadsheet (*.xls) displays the dates only as cell format "General".Even when a manual change of the column's cell format to "Date" is applied, the column cannot be sorted chronologically. Excel still sees it as a string/Text and can only sort it alphanumerically.Various attempts to "value"-copy data into new columns in the same workbook and to change date formats (as delivered from SQL Server & complying to regional settings) did not solve the problem.
Only copying the data out to a text editor and pasting the data back into a new workbook with a new worksheet, allows changing the date columns to "Date" whereas the sort filter works fine now.
This process anyway is absolutely inconvenient for the user and cannot be accepted.
Questions:Is this problem known and does a solution exist?How can we force on creation of the worksheet that the column-cell format is set to Date? (Would this solve the problem anyway?)
Thank you very much in advance for your support
Kind regards,
CD
Hi CD,
Thank you for posting on our forums.
Please note, the UltraWebGrid and UltraWebGridExcelExporter are no longer maintained or supported by Infragistics.
May I ask if you've tried the approach mentioned by Al Tran in his last post on the linked thread below:http://es.infragistics.com/community/forums/p/78089/394319.aspx
Also, you may benefit by installing the latest service release for the version of the Infragistics libraries you are referencing in your project. To learn how you can download the latest service release, please refer to the post linked below:http://es.infragistics.com/community/forums/t/29398.aspx
Hope this helps.
Hi,
Thanks a lot for your support.
a.) ok...I will investigate if Al Tran's proposal can work for me.
b.) What alternatives do exist to replace the UltraWebGrid and UltraWegGridExcelExporter?
We actually also own a license for version 12.x (need to check).
So if I upgrade to a new control which one would I have to use and which one provides me identical functionality to generate an Excel Spreadsheet with multiple worksheets from a grid control?
Thanks again
If you wish to migrate your application to use our newer Aikido controls, please refer to the Infragistics ASP.NET Classic Control Migration Guide page linked below:http://help.infragistics.com/Help/Doc/ASPNET/2014.1/CLR4.0/html/Classic_Control_Migration_Guide.html
Please let me know if you have any questions regarding this matter.