I know that this should be easy but how do I export/save a DataGridView to excel?
相关问题
- 'System.Threading.ThreadAbortException' in
- Excel sunburst chart: Some labels missing
- how to use special characters like '<'
- Error handling only works once
- Excel formula in VBA code
相关文章
- vb.net 关于xps文件操作问题
- Checking for DBNull throws a StrongTypingException
- Get column data by Column name and sheet name
- Using the typical get set properties in C#… with p
- programmatically excel cells to be auto fit width
- Unregister a XLL in Excel (VBA)
- Load a .NET assembly from the application's re
- C# equivalent of VB DLL function declaration (Inte
You could use crystal since it is built into VS. Predefine a crystal report with the appropriate columns and then you can use any datasource you would use for a datagrid or gridview.
You can use this library for more detailed formatting
http://www.carlosag.net/Tools/ExcelXmlWriter/
There are samples in the page.
I setup the gridview and then used the html text writer object to spit it out to a .xls file, like so: