如何asp.net MVC的详细视图数据导出到Excel文件? [英] how to export asp.net MVC detail view data to an excel file?

查看:272
本文介绍了如何asp.net MVC的详细视图数据导出到Excel文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何ASP.NET MVC视图数据导出到Excel文件?
其实我的视图页面包含许多可视数据类型。
我使用这些数据类型的视图页面上显示数据的每个循环。
我的要求是,我想导出此显示的数据为Excel文件。我如何做到这一点?

How to export ASP.NET MVC view data to an excel file ? Actually my view page contain many viewdata types. I am using for each loop with these datatype to displaying data on the view page. My requirement is that I want to export this displayed data into Excel file. How do I achieve this?

感谢

推荐答案

看<一个href=\"http://blogs.msdn.com/erikaehrli/archive/2009/01/30/how-to-export-data-to-excel-from-an-asp-net-application-avoid-the-file-format-differ-prompt.aspx\" rel=\"nofollow\">http://blogs.msdn.com/erikaehrli/archive/2009/01/30/how-to-export-data-to-excel-from-an-asp-net-application-avoid-the-file-format-differ-prompt.aspx.

一些实验后,我使用Open XML SDK 2.0。目前,您可以找到大量的信息如何做到这一点的的http:// MSDN。 microsoft.com/en-us/office/aa905545.aspx http://openxmldeveloper.org/ 。还有一个链接 HTTP://extrememl.$c$cplex.com/ 可能也很有用。

After some experiments I use Open XML SDK 2.0. You can find currently a lot of information how to do this on http://msdn.microsoft.com/en-us/office/aa905545.aspx and http://openxmldeveloper.org/. One more link http://extrememl.codeplex.com/ can be also useful.

在第一时间打开XML SDK 2.0的使用需要多一点时间,因为其他的方法,但导出的文件是真实的Excel文件和不应该由用户转换的。如果你将拥有制作Excel文件格式的更多要求,您将能够实现在那里。

Usage of Open XML SDK 2.0 at the first time take a little more time as other ways, but exported files are real Excel files and should not be converted by users. And if you will be have more requirements for the format of produced excel files, you will be able to implement there.

这篇关于如何asp.net MVC的详细视图数据导出到Excel文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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