How to place your xml data in your Office template file.
The Office 2007 files, DOCX, PPTX, and XLSX are actually zip files. Windward Reports supports using an XML file datasource that is in the Office 2007 file. Here is an example (more info here).
Creating the template with embedded data
- Create the file from_files.docx with the following text:
Name: <wr:out select='/order/customer/name'/>
- Close Word.
- Open from_files.docx in WinZip
- Add to the zip file customXml\item1.xml.
Please note that Word requires this directory and file name. If you use a different directory, Word will delete the file. If you use a different filename, Word will rename it item1.xml.
- Add the following line to the relationships part (document.xml.rels) in the word\_rels folder: http://schemas.openxmlformats.org/officeDocument/2006/relationships..." Target="../customXml/item1.xml" />
- Close WinZip
- Open the file in Word, make an edit, save the file. This will add the files itemProps1.xml & item1.xml.rels to from_files.docx
Creating the report using the embedded data
- In AutoTag select the XML datasource and for the filename enter (AutoTag can use the below engine "jar:..." naming too - but self: does this for the template you are in so you do not need to know the name and location of the template file)
- For the engine (java & .net) pass in a filename of (for .net you may use zip: instead of jar:)