Posted 16 February 2021, 6:53 pm EST
We need functionality to export grid to excel file. The grid has grouped rows (by currency) and when we export, then only values at summary row are displayed with empty values on children. How can we export to excel including all values (at summary level and children level)? This is how we export:
private void SaveMine(string filename) { var ms = new System.IO.MemoryStream(); // grid goes into the memory stream grdCash.Save(ms, FileFormat.Csv); ms.Position = 0; // reset the memory stream or the sheet won't load // memory stream goes into the book var wb = new C1XLBook { CalculationMode = CalculationMode.Auto }; var sheet = wb.Sheets[0]; sheet.LoadCsv(ms); // book gets saved to disk wb.Save(filename, C1.WPF.Excel.FileFormat.OpenXml); }