views:

545

answers:

3

I'm developing printing solution for MS Office 2007. Office automation is not right for me, because it requires Office to be installed. Open XML Document Viewer is solution for converting Word files (.docx) to HTML format by XSLT transform, but it works only for .docx. Can the same technology be used for Excel spreadsheets files?

A: 

If you're looking at Excel 97-03 (xls) or Excel 2007 (xlsx) files then I'd recommend FlexCel. I've used it, is very good and honestly quite cheap compared to it's competition.

Note that it doesn't fully support all formatting present in Excel 2007 yet I don't think. But it does have built in functionality to export to HTML.

Ian
Thanks, but proprietary or shareware libs are not suitable for me :(
necrostaz
You might want to put that in the original question then as its not clear.
Ian
A: 

You could write a SpreadsheetML parser. The schema is available online from Microsoft.

I wrote one a while back that covered data, structure and basic formatting to throw it throw a library and re-save it as an XLS file. Wasn't too difficult.

Ian
This schema for 2002 Office, but i need OpenXml SpreadsheetML which schema is difficult, therefore i need to find any existing solutions :(
necrostaz
OpenXml and SpreadsheetML aren't the same thing... SpreadsheetML specfically refers to the XML format present in Office 2003 and later. Not XLSX files. Don't combine OpenXml and SpreadsheetML in the same sentence if referring to just a single thing.
Ian
xslx = Excel Extensions to the Office Open XML SpreadsheetML http://msdn.microsoft.com/en-us/library/dd922181.aspxand anywhere in open xml community used SpreadsheetMl term, but initially it defined for Office 2003.For Office 2003 it has schema urn:schemas-microsoft-com:office:spreadsheet, for XLSX - http://schemas.openxmlformats.org/spreadsheetml/2006/main
necrostaz
+1  A: 

You could use this article XSL transformation of SpreadsheetML to HTML as a starting point to develop your own transform. You can also look at the open source XSLTs in OpenXML/ODF Translator Add-ins for Office to get some ideas on things you may need to account for in any conversion outside of OOXML. The one thing to keep in mind is that SpreadsheetML is more similiar to PresentationML than it is to WordprocessingML in file structure inside the package (i.e. for every sheet, there is a seperate file).

If your doing this from .NET, I'd do this from LINQ instead of XSLT. I've done transforms from DrawingML into SVG and Linq makes it easy (in terms of similiar functionality to XSLT, staying within .NET, etc.)

Otaku
thanks for your response! I've already work on open office and openxml-odf translators code, also i was read XSL transformation of SpreadsheetML to HTML article but i suppose it no more effective way.
necrostaz