Solved

Tables in word document Open XML

Posted on 2009-04-08
2
743 Views
Last Modified: 2013-11-10
Hi folks, I have been spinning my wheels for a couple of days on an issue with server side open xml code. I have a word template that I want to fill, with a general information part, and a table below. The general information part I was able to populate using content controls and it works fine. The problem I am having is with the table, it is dynamically generated based on a dataset, I'm not sure what to use to create the table, should i use content controls? create the table from scratch, try to find the table in the template and modify it? any one has exprience with this? I'd greatly appreciate any help in the mater.

Thanks
Z
0
Comment
Question by:zaidmarji
2 Comments
 
LVL 19

Expert Comment

by:daveamour
ID: 24106799
I created xml word docs once.
I created the template layout manually so it was just as I wanted then saved that as xml.
Then I grabbed data from a DataSet using GetXml() Then used XSLT to combien the two.
Pretty easy and worked very well.
0
 

Accepted Solution

by:
zaidmarji earned 0 total points
ID: 24163468
Thanks Dave,

The data i wanted to display was all dynamic, so i couldnt have anything preset, I found the blog below, which even if you cannot understand the language, the code is well written and does the trick. I've expanded it and created my own class that not only creates the table that from the dataset, it also can append new single rows as needed.

http://www.cnblogs.com/duhongyu216/articles/1366855.htmlhttp://www.cnblogs.com/duhongyu216/articles/1366855.html
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question