Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this questionI'm curious as to how many people are using Open XML (OOXML) these days (either pure or via the SDK) in closed and commercial environments. I'm fairly aware of what's going on on the 'public web' (MSDN, OpenXMLDeveloper.org, etc.), but am wondering about SO people's experience with it, both good and bad.
Are most people opting out of VBA and VSTO in favor of working directly with OOXML formats? What benefits are you getting from OOXML that you're not getting from the object model. I'd love to learn more about why you're using it or why you're not, what are you using it for, etc.
I'm just trying to get a feel from the community on OOXML as an approach toward document automation or other uses. I'm not finding community forums (this one or others) to be incredibly active with questions and users (check out the number of questions by tag of this post), so I'm wondering if I'm one of the very few who is 开发者_Python百科using OOXML extensively.
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.
Libraries like Simple OOXML can also greatly help with the learning curve.
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.
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.
I am doing the scenario that sales performance for a country is delivered in PPT Deck using Open XML
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.
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.
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.
精彩评论