Solved

Tables in word document Open XML

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.

758 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

22 Experts available now in Live!

Get 1:1 Help Now