Is there away to save data to csv file instead of excel. I am using a FileHelperEngine which is responsible for a comma delimited file. At the moment I am exporting to csv from the file dialog, but the filehelperengine does not recognized the file as csv until I resave to CSV from excel. i am currently doing this below
SaveFileDialog saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.InitialDirectory = @"C:\"; saveFileDialog1.Title = "Save EasyTimesheet CSV"; saveFileDialog1.DefaultExt = "csv"; saveFileDialog1.Filter = "CSV files (*.csv)|*.csv|All files (*.*)|*.*"; saveFileDialog1.FilterIndex = 2; saveFileDialog1.FileName = filenameFormat; saveFileDialog1.RestoreDirectory = true;
if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { return saveFileDialog1.FileName; } else return filename; }
--------------------
this.dgTimeSheets.DataSource = _DataViewCSVImport;
FileInfo fileInfo = new FileInfo(filename);
Workbook workbook = new Workbook(WorkbookFormat.Excel2007); Worksheet ws1 = workbook.Worksheets.Add(fileInfo.Name);
DataPresenterExcelExporter exporter = new DataPresenterExcelExporter();
exporter.Export(this.dgTimeSheets, workbook); workbook.Save(filename);
Hello Darnell,
Currently, the Workbook class does not support saving and loading to and from CSV files. It only supports the formats found in the WorkbookFormat Enumeration described in the following topic:
http://help.infragistics.com/doc/WPF/2015.2/CLR4.0/?page=InfragisticsWPF4.Documents.Excel.v15.2~Infragistics.Documents.Excel.WorkbookFormat.html
The following table illustrates how these formats map to MS Excel formats:
Member
Description
Excel Save As Dialog Format
Excel2007
The Excel 2007 XML file format.
Excel Workbook (*.xlsx)
Excel2007MacroEnabled
The Excel 2007 Macro-Enabled XML file format.
Excel Macro-Enabled Workbook (*.xlsm)
Excel2007MacroEnabledTemplate
The Excel 2007 Macro-Enabled Template XML file format.
Excel Macro-Enabled Template (*.xlst)
Excel2007Template
The Excel 2007 Template XML file format.
Excel Template (*.xltx)
Excel97To2003
The Excel 97-2003 BIFF8 file format.
Excel 97-2003 Workbook (*.xls)
Excel97To2003Template
The Excel 97-2003 Template BIFF8 file format.
Excel 97-2003 Template (*.xlt)
StrictOpenXml
The Strict Open XML file format (ISO/IEC 29500 Strict).
Strict Open XML Spreadsheet (*.xlsx)
If you have any further questions on the matter do not hesitate to contact us.
You guys should add a csv exporter in the next version of your software. Where the exporter, exports to an csv file.
What is another possible route I can take regarding this issue.