导入和导出Excel中 - 什么是最好的图书馆吗? [英] Import and Export Excel - What is the best library?

查看:128
本文介绍了导入和导出Excel中 - 什么是最好的图书馆吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们在C#ASP.NET应用程序之一,我们采取一定的数据收集(亚音速的集合),并将其导出到Excel。我们也希望导入特定格式的Excel文件。我正在寻找一个图书馆,我可以用于此目的。

In one of our ASP.NET applications in C#, we take a certain data collection (SubSonic collection) and export it to Excel. We also want to import Excel files in a specific format. I'm looking for a library I can use for this purpose.

要求:


  • Excel 2007中的文件(不Excel 2003中支持超过64K行?我需要不止于此。)

  • 不需要Excel中的服务器上

  • 获取一个类型集合,如果可以,试图把数字领域在Excel中的数字。

  • 大文件(100K到10M)效​​果很好 - 足够快

  • 出口的GUID当
  • 不死机!

  • 不费钱的crapload(无企业库就像阅读Aspose)。免费永远是伟大的,但可能是一个商业库。

你推荐什么库?你有没有用它为大量的数据?是否有其他解决办法?

What library do you recommend? Have you used it for large quantities of data? Are there other solutions?

现在,我使用的是简单的工具,生成一个用Excel加载稍后HTML,但我失去了一些功能,加上当我们加载它Excel的抱怨。我并不需要生成图表或类似的东西,只是出口的原始数据。

Right now, I am using a simple tool that generates HTML that is loaded by Excel later on, but I am losing some capabilities, plus Excel complains when we load it. I don't need to generate charts or anything like that, just export raw data.

我想到的是平面CSV文件,但Excel是客户的要求。我可以CSV直接合作,如果我不得不转换并从Excel的工具。由于Excel 2007是一个(和压缩)基于XML的文件格式,我猜测这个类库应该很容易找到。然而,最重要的事情对我来说是你的意见和建议。

I am thinking of flat CSV files, but Excel is a customer requirement. I can work with CSV directly, if I had a tool to convert to and from Excel. Given Excel 2007 is an xml-based (and zipped) file format, I am guessing this kind of library should be easy to find. However, what matters most to me are your comments and opinions.

编辑:讽刺的是,在我看来并按照得票最多的答案,最好的Excel导入和放大器;出口库是没有出口的。这不是所有场景的情况下,但它是对我的。 XLS文件只支持64K行。 XLSX支持高达100万。我已经尝试了免费的图书馆功能的糟糕表现(1秒,当你有20万行装载一列)。我还没有尝试有偿的人,因为我觉得他们高估了他们交付时,所有你需要的是一个快速XLSX&LT值; - > CSV转换过程。

Ironically, in my opinion and following the answer with the most votes, the best Excel import&export library is no export at all. This is not the case for all scenarios, but it is for mine. XLS files support only 64k rows. XLSX supports up to 1M. The free libraries that I've tried feature bad performance (one second to load one row when you have 200k rows). I haven't tried the paid ones, as I feel they are overpriced for the value they deliver when all you need is a fast XLSX<->CSV conversion routine.

推荐答案

我要走了,把我的手在平面CSV文件,如果仅仅是因为你已经得到了超过code中的最大程度的控制。只要确保你的行读取和处理它们一次。(阅读文档末尾和分裂会吃掉所有你的记忆 - 同样的写作,流出来)

I'm going to throw my hand in for flat csv files, if only because you've got the greatest control over the code. Just make sure that you read in the rows and process them one at a time (reading the document to the end and splitting will eat up all of your memory - same with writing, stream it out).

是的,用户必须保存为CSV在Excel中,然后才能对其进行处理,但也许这种限制可以通过培训和网页上提供明确的指示克服?

Yes, the user will have to save-as CSV in excel before you can process it, but perhaps this limitation can be overcome by training and providing clear instructions on the page?

最后,当您导出到客户,如果您设置MIME类型为text / CSV,Excel中通常是映射到类型,以便在用户看来是'一个Excel文件'。

Finally, when you export to the customer, if you set the mime type to text/csv, Excel is usually mapped to that type so it appears to the user to be 'an Excel file'.

这篇关于导入和导出Excel中 - 什么是最好的图书馆吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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