C#在控制台应用程序中创建一个gridview并将其转换为excel [英] C# Create a gridview in console application and convert it as excel

查看:62
本文介绍了C#在控制台应用程序中创建一个gridview并将其转换为excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在开发一个c#控制台应用程序,它应该通过从数据库中提取数据并作为excel附件发送来创建excel文档。由于excel未安装在服务器中,并且没有任何其他开源软件的选项,我计划创建gridview并将其转换为excel。当我在google搜索时,他们中的大部分人都说我们无法在控制台中创建gridview,但我在一些论坛中看到过一次我现在无法找到的代码。



任何人都可以告诉我是否可以使用C#在控制台中实现gridview。



在此先感谢

Prashant

解决方案

我建​​议你使用EPPlus进行excel导出..这只是你需要引用你的项目的一个dll,所以我不认为这是一个问题。

Hi ,

I am developing a c# console application which should create an excel document by extracting the data from DB and sends as an excel attachment. As excel is not installed in the server and there is no option for any other open source softwares I am planning to create a gridview and convert it as excel. As I searched in the google most of them are saying that we cant create a gridview in console but I have seen the code once in some forum which I am unable to find now.

Can any one advise me whether I can implement the gridview in console using C#.

Thanks In Advance
Prashant

解决方案

I would suggest you to use EPPlus for excel export.. It's just a dll that you need to reference with your project so I dont think theres a problem with that.


这篇关于C#在控制台应用程序中创建一个gridview并将其转换为excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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