- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
3 Posted Topics
Hi, here is my code //Load Excel Workbook workbook = new Workbook(); workbook.LoadFromFile(@"..\..\parts.xls",ExcelVersion.Version97to2003); Worksheet sheet = workbook.Worksheets[0]; //Export to DataGridView DataTable dataTable = sheet.ExportDataTable(); this.dataGridView1.DataSource = dataTable; I use a [.NET Excel](http://www.e-iceblue.com/Introduce/excel-for-net-introduce.html) component
I use a [free Data Export component](http://www.e-iceblue.com/Introduce/free-dataexport-component.html) to export and find that the head column can be displayed. Code here: Spire.DataExport.XLS.CellExport cellExport = new Spire.DataExport.XLS.CellExport(); Spire.DataExport.XLS.WorkSheet worksheet1 = new Spire.DataExport.XLS.WorkSheet(); worksheet1.DataSource = Spire.DataExport.Common.ExportSource.DataTable; worksheet1.DataTable = dt; worksheet1.StartDataCol = ((System.Byte)(0)); cellExport.Sheets.Add(worksheet1);
Hello, Is the data information of school time table is saved in databased? If so, just use [Data Export component](http://www.e-iceblue.com/Introduce/data-export-for-net-intro.html) to export data to Excel and set format. If there is no specified information, you can create a new workbook and import data to it, then set format. Please tell …
The End.