我如何编程创建,读取,而无需安装办公室写一个Excel? [英] How can I programatically create, read, write an excel without having office installed?

查看:92
本文介绍了我如何编程创建,读取,而无需安装办公室写一个Excel?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑,所有的bazillion的方式来读/写/地狱创建Excel文件。 VSTO,OLEDB等,但它们都看起来的有必须安装Office的要求。

I'm confused as hell with all the bazillion ways to read/write/create excel files. VSTO, OLEDB, etc, but they all seem to have the requirement that office must be installed.

下面是我的情况:我需要开发一个应用程序将采取一个Excel文件作为输入,做一些计算,并创建一个新的excel文件,这将基本上是第一个excel文件的修改。所有与运行此机器可能没有安装Office的约束。 (不要问为什么......)

Here is my situation: I need to develop an app which will take an excel file as input, do some calculations and create a new excel file which will basically be a modification of the first excel file. All with the constraint that the machine that runs this may not have office installed. (Don't ask why...)

任何想法?

我需要支持的所有的出色格式。唯一的救命之恩是格式小号preadsheets本身是非常简单的。只是一堆列和值,没有什么花哨的。不幸的是没有为CSV最终用户可能甚至不知道一个CSV文件是什么。

I need to support all excel formats. The only saving grace is that the formats spreadsheets themselves are really simple. Just a bunch of columns and values, nothing fancy. And unfortunately no CSV as the end user might not even know what a CSV file is.

推荐答案

写您的Excel以HTML表格形式:

write your excel in HTML table format:

<html>
<body>
  <table>
    <tr>
    <td style="background-color:#acc3ff">Cell1</td>
    <td style="font-weight:bold">Cell2</td>
    </tr>
  </table>
</body>
</html>

和给你的文件中XLS扩展。 Excel将自动转换

and give your file an xls extension. Excel will convert it automatically

这篇关于我如何编程创建,读取,而无需安装办公室写一个Excel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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