Open XML 的流行程度如何?

发布于 2024-08-16 03:57:20 字数 1431 浏览 8 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

咿呀咿呀哟 2024-08-23 03:57:21

我们最近从 Word Interop 迁移到 Open XML。

我们的应用程序用于创建 Word 和 pdf 格式的发票。使用 Interop 时,生成一张相当大的发票大约需要 5-10 分钟。
现在,使用 OpenXML 和 SSRS,该时间已减少到大约 30 秒。
Word 的唯一问题是某些功能无法向后兼容 Word 2010 到 2007,这需要一些时间来修复、启动和运行。比如创建目录、合并文档等。

除此之外,我认为 Linq、MSDN 和 Eric怀特的博客足以让您朝着正确的方向前进。

We migrated from Word Interop to Open XML very recently.

Our application is used for creating Invoices in the Word and pdf format. When Interop was used, a decent size Invoice took about 5-10 minutes to generate.
Now, using OpenXML and SSRS that time has been reduced to approximately 30 seconds.
The only problem area with Word was that some features were not backward compatible from Word 2010 to 2007 and that took some time to fix and get up and running. Like creating the Table of Contents, merging documents etc.

Other than that, I think Linq, MSDN and Eric White's Blog is enough to get you going in the right direction.

握住我的手 2024-08-23 03:57:20

既然 Microsoft Office 2007(尤其是 Excel)支持 Open XML,我发现它比 Office Automation 更容易使用。这样做的几个主要原因是:

  • 更好的性能;
  • 没有不稳定的 IPC 问题(即有人在“另存为”对话框中打开 Excel,导致崩溃);
  • 不依赖 Office 本身或任何外部组件;
  • 在 C# 中编写 Linq 扩展和查询相当容易;
  • 可以在服务器环境中使用,没有任何问题或风险。

鉴于 Office XP/2003 用户可以使用兼容包打开 Office 2007 文件,我认为没有任何理由继续使用旧的自动化或“OfficeML”方法。这是一个学习曲线,但它可以说是当今最好的选择 - 它是免费的、可靠的,最重要的是它是 Office 2007 当今使用的本机格式,您不需要任何愚蠢的东西让它工作的技巧(比如像我们对 XL2003 所做的那样将 XLS 内容类型附加到 HTML,以及让 XL2007 抱怨扩展名不正确)。

我不会说它是 VBA/VSTO 的彻底替代 - 它们通常是解决方案的一部分,其中要求与 Office 环境本身集成。使用 OOXML 通常需要您围绕它编写整个应用程序。但对于简单的导入/导出(这可能是过去 90% 的自动化所使用的),OOXML 无疑是最佳选择。

Now that Microsoft Office 2007 (and especially Excel) support Open XML, I'm finding it far easier to work with than Office Automation. A few major reasons for this are:

  • Better performance;
  • No flakey IPC issues (i.e. somebody left Excel open at the Save As dialog, crash);
  • No dependency on Office itself, or any external components whatsoever;
  • Fairly easy to write Linq extensions and queries against in C#;
  • Can be used in server environments without any problems or risks.

Given that Office XP/2003 users can open Office 2007 files with the Compatibility Pack, I don't see any reason to continue using the old automation or "OfficeML" methods. It's a bit of a learning curve, but it's arguably the best option today - it's free, it's reliable, and best of all it's the native format used by Office 2007 today and you don't need any stupid tricks to get it to work (like attaching the XLS content-type to HTML as we did for XL2003, and having XL2007 complain about an incorrect extension).

I wouldn't say it's an outright replacement for VBA/VSTO - the thing about those is that they're usually part of a solution where the requirement is to integrate with the Office environment itself. Using OOXML would generally require you to write an entire application around it. But for simple import/export, which is probably what 90% of automation has been used for in the past, definitely, OOXML is the way to go.

哭泣的笑容 2024-08-23 03:57:20

Simple OOXML 这样的库也可以极大地帮助学习曲线。

Libraries like Simple OOXML can also greatly help with the learning curve.

夏九 2024-08-23 03:57:20

我们使用 Open XML SDK 导出到 Excel。我不得不说它非常慢,所以我们必须自己做一些缓存(对于共享字符串)。该库只是 Open XML 格式的对象表示。有时这可能是好事,有时则不是。特别是当您必须非常了解 Open XML 标准时,因为 SDK 不会为您处理任何事情。你必须知道该格式带来的所有限制,你必须知道在 xlsx 或 docx 等中不能省略哪些元素。它允许你创建不一致的 Excel 电子表格或 Word 文档,这是不好的。好吧,至少是免费的:)总比没有好。

We are using Open XML SDK for export to Excel. I have to say it is quite slow so we had to do some caching on our own (for shared strings). The library is just an object representation of the Open XML format. Sometimes it can be good thing, sometimes not. Especially when you have to know Open XML standard very well because the SDK won't handle anything for you. You have to know all the restrictions the format brings, you have to know which elements you cannot ommit in xlsx or docx, etc. It allows you to create inconsistent excel spreadsheets or word documents which is not good. Well, it's free at least :) Better than nothing.

忆依然 2024-08-23 03:57:20

我使用 Open Xml SDK 在 SharePoint 中生成文档、生成自定义演示文稿的 PPTX(从 XSLX 中提取数据)以及从多个文档段“构建”复合文档。

格式和 SDK 都很棒。 ASP.NET或SharePoint场景下不用担心服务器,而且速度很快。我还没有发现太多 SDK 或“暴力”xml 无法实现目标的场景。一个例子是文档的密码保护和 DRM,但这些都是更极端的情况。我同意 aaronaught 的观点,即这不是一个专有的解决方案,但 SharePoint、VSTO 和其他工具是工具带中的工具文档生成解决方案。

I have used Open Xml SDK for document generation in SharePoint, PPTX generation for custom presentations (pulling from XSLX for the data) and for "building" composite documents from multiple document segments.

The format and the SDK are great. No worries on the server in ASP.NET or SharePoint scenarios, and great speed. I have not found too many scenarios where the SDK or "brute force" xml cannot accomplish a goal. One instance is password protection and DRM for documents, but these are more corner cases. I would agree with aaronaught that this is not an exclusive solution, but SharePoint, VSTO and others are tools in the tool belt for document generation solutions.

辞旧 2024-08-23 03:57:20

我正在做一个场景,使用 Open XML 在 PPT Deck 中提供一个国家/地区的销售业绩

I am doing the scenario that sales performance for a country is delivered in PPT Deck using Open XML

幸福%小乖 2024-08-23 03:57:20

我对这项技术进行了很多研究,我使用 VBA 进行编程,但它对于我的需求来说太复杂了。使用它有一些很棒的东西可以让我的电子学习受益,比如 Linq 和 XML,但是从 VBA 转向底层格式的门槛太高了,我没有足够的时间和金钱这需要投资学习 VS.Net 和 Open Office XML 格式。

但我认为它真正有帮助的一件事是为 LMS 的 PowerPoint 内容进行元标记。

I looked at this technology a lot, I program in VBA, but it was way way to complex for my needs. There are some great things about using it that my elearning would benefit from, like Linq and XML, but the bar for going from VBA to the underlying formats is just too high and I don't have the luxury of the kind of time and money it would take investing in learning VS.Net and Open Office XML formats.

But the one thing I think it would really help with is meta-tagging PowerPoint content for an LMS.

风筝在阴天搁浅。 2024-08-23 03:57:20

我用它来解析 pptx 文件,寻找形状中的特殊注释。这些评论是其他资源的链接(最常见的是 uri、PDF 文件等)。然后,我使用 deepzoom 软件渲染 pptx,然后渲染形状内部的 uri。有趣,但很慢。用它来帮助研究和查看海报的“新颖”方式。但这不是LOB。

I've used it to parse pptx files, looking for special comments in shapes. These comments are links to other resources (uri's most often, PDF files, etc.). I then use deepzoom software to render the pptx and then render the uri's inside the shape. Fun, but slow. Use it to help with research and a "novel" way to look at posters. But this isn't LOB.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文