如何使用ASP.NET C#查看excel文件? [英] How to view the excel file using ASP.NET C#?

查看:76
本文介绍了如何使用ASP.NET C#查看excel文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在文件上传按钮上传excel文件。点击show按钮查看excel表示excel的弹出视图(如果在gmail中附加excel文件,在弹出窗口中查看excel文件)怎么做。 br $> b $ b

我尝试过的事情:



我在网上搜索参考但是excel查看应用程序仅可用。

i upload the excel file in file upload button.and click the show button to view the excel means pop up view of excel (if attached excel file in gmail and view the excel file in popup window )how to do it.

What I have tried:

I have search online for reference but the excel viewing application only available.

推荐答案

可能会在链接下面对你有用......看看吧!



如何打开Excel浏览器上的文件...在asp.net c# [ ^ ]



和这一个



取并在ASP.Net中阅读带有GMAIL POP3邮件服务器附件的电子邮件 [ ^ ]
May below links will be useful to you..have a look !

how to open excel file on browser ...in asp.net c#[^]

and this one

Fetch and read email messages with attachments from GMAIL POP3 mail server in ASP.Net[^]


他们渲染上传文件内容使用本机HTML呈现文件。浏览器无法呈现特殊文件类型,例如PDF,MS Word和MS Excel等。您需要在浏览器上安装插件,或者需要使用HTML呈现它,为此您需要从中读取所有内容文件,然后使用表格,网格视图等呈现它。否则浏览器将只是将文件下载到磁盘。



您的最佳出价是使用Excel到HTML转换器,将Excel工作表数据转换为HTML表格元素。你可以在网上找到数百个。 Google [ ^ ]会有所帮助。还创建了特殊库, .NET Office [ ^ ]等可以在这里使用。但选择权在你手中。
They render the uploaded files themselves using the content of files, rendered in native HTML. Browsers are unable to render special file types, such as PDF, MS Word and MS Excel etc. You need either a plugin to be installed on the browser, or you need to render it using HTML, and for that you need to read everything from file and then render it using tables, gridviews etc. Otherwise browser will simply download the file to disk.

Your best bid is to use an Excel to HTML converter, that converts your Excel sheet data to an HTML table element. You can find hundreds of them online. Google[^] will help. There are special libraries created too, .NET Office[^] etc that can be utilized here. But choice is yours.


这篇关于如何使用ASP.NET C#查看excel文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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