Solved

Tables in word document Open XML

Posted on 2009-04-08
2
740 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

809 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