需要工具/ DLL将数据从网格导出到excel [英] Need tool/ DLL to export data from grid to excel

查看:63
本文介绍了需要工具/ DLL将数据从网格导出到excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用dll将数据从grid导出到excel。需要dll以便它可以在整个解决方案中使用,也希望避免相同的代码重复及其对于asp网站项目。请帮忙??



我尝试过:



试用代码可以使用c#导出到excel,但想要一些工具或dll来避免代码的声誉

I want to use dll to export data from grid to excel. Need dll so that it can be used in whole solution, also want to avoid same repetition of code and its for asp web site project. Please help??

What I have tried:

Tried code available for export to excel using c#, but want some tool or dll to avoid reputation of code

推荐答案

使用Excel互操作是一个坏主意,因为它不受支持,它会失败并给你各种错误。毫无疑问,你仍然在你的本地开发机器上编码,并且还没有尝试部署它,所以不知道你面临的问题。



而是使用一个旨在从asp.net执行此操作的库。谷歌开源库阅读excel asp.net,你会找到一些可能的候选人;



c# - 导入和导出Excel - 什么是最好的库? - Stack Overflow [ ^ ]



您可以使用Open XML SDK或Excel ODBC驱动程序,但有很多第三方库也是。
Using Excel interop is a bad idea as it isn't supported and it's going to fail and give you all sorts of errors. Also no doubt you're still coding this on your local development machine and haven't tried to deploy it yet so have no idea the issues you face.

Instead use a library that is designed to do this from asp.net. google "open source library reading excel asp.net" and you'll find some likely candidates;

c# - Import and Export Excel - What is the best library? - Stack Overflow[^]

You can use the Open XML SDK or the Excel ODBC driver, but there are lots of third party libraries out there too.


所以把你的导出代码放到一个单独的库项目中(默认情况下会编译成一个dll) - 我无法想象你的问题是什么?
so put your export code to a separate library project (which will compile to a dll by Default) - I can not imagine what could be your problem with that?


这篇关于需要工具/ DLL将数据从网格导出到excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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