开发者

How to create a Word document from a Silverlight 4 application?

I'm looking for some options to programmatically create a Word document from within a Silverlight 4 application. I found two approaches which seemed promising at first but don't look like they will work.

OpenXML SDK The OpenXML SDK isn't available for Silverlight at this time.

Word Automation via COM Interop

dynamic word开发者_如何学JAVAApplication = AutomationFactory.CreateObject("Word.Application");

Apparently this requires that the Silverlight 4 application be granted permission to run with elevated privileges, which is only available for out-of-browser applications (which ours isn't)

My other thought is to hand off the request to a back-end service which doesn't have these limitations. I wanted to check for any ideas before going down that path.


A back-end service is the way to go. Neither Open XML SDK (the easy way) or System.IO.Packaging (the harder way) is available from Silverlight, so server-side generation is the only real option here. You can do it yourself (which would be my preference), or use tools such as OfficeWriter or Sharp Shooter (mentioned in another answer). The plus side of a back-end solution is that you wouldn't have anyone decompiling your Word-creation code with tools like Reflector.


http://www.perpetuumsoft.com/Report-Sharp-Shooter-for-Silverlight.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜