Output XML File Using Office Open XML Standard

  • Hi

    I'm building a LOB application and currently looking into producing/printing documents from the new application. The customer requires the documents to be produced in a MS Word 2007 format (docx) or simliar format for Word to open the document. In the past I would have jumped on the mail merge band wagon as it seemed to be the best way to produce say a 400 page document from data in the database.

    Now my question, as Word 2007 supports the Open XML standard I was wondering if I'm able to use SQL Server 2008 to produce an XML file based on this standard? If so, how can I achieve this goal?

    XML within SQL Server is quite new to me and I'm unsure of its capabilities as I'm used to using XML in separate layer in the client app so any help or advice would be most appreciated.

    Colin

  • Hi,

    would you please be a little more specific on what you're trying to do?

    For reference on how to post data please see http://www.sqlservercentral.com/articles/Best+Practices/61537/.

    For a start you could look up "FOR XML" in BOL and in this forum.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Your application should be what is providing an output in a particular format, not SQL Server. SQL provides a data layer.

    Previously to output MS Office documents you had to use OLE automation. This was nasty and didn't scale. Also, it is only supported client-side.

    Recently MS have released the OpenXML SDK v2.0. It enables a developer to output OpenXML to create Word, Excel and PowerPoint files in 2007 formats. One of the cool tools included in the SDK is the new Reflector which will supply .NET code to create a specified document.

    Check out the Channel9 MSDN Video and the MS download

    http://channel9.msdn.com/posts/LarryLarsen/Office-Tools-for-Devs/

    http://www.microsoft.com/downloads/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang=en

    --
    Andrew Hatfield

  • Thanks for the reply's

    I've done bit more research into Open XML for Office 2007 and released that I should probably using SQL to return data as xml and handle the creation of the documents within the application itself. I'll use Word's content controls and bind the data to those controls.

    Thanks again for the help

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply