While using the ExcelWriter to export dates I get this results:
ger: 10.09.2015 - > in Excel : 10092015 (Points are replaced, no date format)
eng: 09/10/2015 → in Excel: 09/10/2015 (no date format)
Any Solutions ? Thx for your help.
[code]
[HttpPost, Route(“dhtmlxGrid/excel”)]
public HttpResponseMessage dhtmlxGridExcel()
{
var generator = new ExcelWriter();
var xml = HttpContext.Current.Server.UrlDecode(HttpContext.Current.Request.Form[“grid_xml”]);
MemoryStream excel = generator.Generate(xml);
HttpResponseMessage result = Request.CreateResponse(HttpStatusCode.OK);
result.Content = new ByteArrayContent(excel.GetBuffer());
result.Content.Headers.ContentType = new MediaTypeHeaderValue(generator.ContentType);
result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");
result.Content.Headers.ContentLength = excel.Length;
result.Content.Headers.ContentDisposition.FileName = "Grid" + ".xlsx";
return result;
}[/code]
Hello,
unfortunately currently there is no good way for managing cell types and formatting with our export tool.
Although, you can get some control of it after modifying the source codes of the export library.
If you find ExcelWriter.rowsPrint, you can see where the values from the grid are put into cells of the result spreadsheet:
At that point the code has no info of actual column types, but you can try parse cell values into numbers or DateTimes. Cell formatting will be applied after the type you assign into the cell: screencast.com/t/RXxpebd6vTnk
Note that the parsing will be done according to server culture and globalization settings, you may want to specify them explicitly either in .TryParse call, or in web config stackoverflow.com/questions/1100 … balization