May 22, 2009 at 3:29 am
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
May 23, 2009 at 2:54 am
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.
May 23, 2009 at 5:42 am
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/
--
Andrew Hatfield
May 23, 2009 at 8:52 am
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