导出和excel文件到html [英] Export and excel file to html

查看:92
本文介绍了导出和excel文件到html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello every1



我有一个excel文件,我想根据我们的客户要求将其导出到html。如何在不使用办公室互操作的情况下完成。





提前谢谢。

Hello every1

i have an excel file and i want to export it to html as per our client requirement. how can i do it without using office interop.


thank you in advance.

推荐答案

有.net可以读取xls和/或xlsx的libabries(甚至是免费的)(谷歌会帮助)。

例如这一个: http://exceldatareader.codeplex.com/ [ ^ ],可以读取borth,但没有我看到的格式。



选择正确的一个取决于这个导出应该如何执行(只有内容很重要,或者你需要遵循精确的样式),以及这个excel文件包含的内容(只有数据和公式,或者是有任何外部引用,或者甚至是嵌入对象)。



我认为如果你有嵌入对象,你将无法避免使用Excel或其他一些excel兼容的电子表格编辑器互操作 - 或者你必须编写很多代码。
There are .net libabries (even free) out there (google will help) that can read xls and/or xlsx.
For example this one: http://exceldatareader.codeplex.com/[^], that can read borth, but no formatting as I see.

Choosing the right one depends on how exactly this export should be performed (only content matters, or you need to follow exact styling), and what exactly this excel file contains (only data and formulas, or are there any external references, or are there even embedded objects).

I think if you have embedded objects, you will not be able not avoid using Excel or some other excel-compatible spreadsheet editor interop - or you will have to code a lot.


将文件转换为csv,将逗号分成字符串数组。



将数组中的元素添加到html文件中。
Convert the file to csv, the split it on commas into an string array.

Add the elements from your array to your html file.


感谢大家的提示回应我。我还是无法解决。我决定是通过oledb从excel中读取数据并将其转换为xml。稍后将xml显示为html。我已经成功将excel转换为xml但xml到html没有成功。



谢谢大家
Thanks to all of you for your prompt response to me. i am unable to solve it yet. what i have decided is to read the data from the excel through oledb and convert it into xml. later on make that xml display as html. i have got success in converting excel to xml but no success with xml to html.

Thank you all


这篇关于导出和excel文件到html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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