Solved

Tables in word document Open XML

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…

864 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now