views:

667

answers:

2

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.

+2  A: 

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.

ChrisW
A: 

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

0xA3