问题
I need to know how we can Generate WordML Reports Using Templates and XPath using ASP.Net. What are its advantages.
A Simple How To Tutorial is what I require.
回答1:
I need to know how we can Generate WordML Reports Using Templates and XPath using ASP.Net. ... A Simple How To Tutorial is what I require.
Create (using Word) a document in WordML format which you'll use as a template.
Look at your WordML template: see that it's in XML format. Have Microsoft's WordML reference documentation, so that you understand what it means and how to modify it.
Define XPath expressions which identify the locations in your template which you want to modify (where "modify" probably means "insert data at run time").
At runtime use an API like http://www.google.com/search?hl=en&q=c%23+xpath
What are its advantages.
Its advantages over what alternative?
The benefit is that the output is a Word document, whose content is based on a template plus modifications made at runtime.
回答2:
I would recommend you to use Content Controls and Custom XML for the purpose of report generation. Here's a sample:
http://blogs.msdn.com/erikaehrli/archive/2006/08/11/word2007DataDocumentGenerationPart1.aspx
You might also want to have a look at Microsoft's OpenXML SDK v2.0
来源:https://stackoverflow.com/questions/409020/generating-wordml-reports-using-templates-and-xpath-using-asp-net