在excel C#windows应用程序中导出数据 [英] Export data in excel C# windows application

查看:136
本文介绍了在excel C#windows应用程序中导出数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用winodows表单应用程序。在此我有一个从记事本文件中读取数据的任务,需要导出到excel.Fo这我需要生成不同的excel报告

sheets.Here我最终导出excel表中的数据我使用的是datatable类型的列表。因此,该列表中的每个表都应该逐个填充到工作簿中的excel表。

能否解释一下如何解决这个问题。



private void ExportToExcel(List< system.data.datatable> lstdTable)

{



//逻辑这里

}

请举例说明



我尝试了什么:



我正在使用winodows表单应用程序。在此我有一个任务从记事本文件中读取数据并需要导出到excel。为此我需要使用不同的

工作表生成excel报告。

Hi,
I am using winodows forms application.In this I have a task of reading data from notepad file and needs to export to excel.Fo this I need to generate excel report with different
sheets.Here I finally for exporting data in excel sheet I am using list of type datatable.So each table in that list should be populated to the excel sheets in workbook one by one.
Could you please explain how to overcome this.

private void ExportToExcel(List<system.data.datatable> lstdTable)
{

//Logic Here
}
Please explain with an example

What I have tried:

I am using winodows forms application.In this I have a task of reading data from notepad file and needs to export to excel.Fo this I need to generate excel report with different
sheets.

推荐答案

谷歌了吗?

快速搜索的第一批结果之一: c# - 如何将DataTable导出到Excel - 堆栈溢出 [ ^ ]。


这篇关于在excel C#windows应用程序中导出数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆