Well I got this to work - eventually - without necessarily
understanding the XML behind it.I cut & pasted all the XML garbage
from either side of my data in the template - and it worked.
Here is my code for writing that table:
if (noOfItems > 0)
{
// table header row
sVal = "<w:tbl><w:tblPr><w:tblW w:w=\"8640\" w:type=
\"dxa\"/><w:tblLayout w:type=\"Fixed\"/></
w:tblPr><w:tblGrid><w:gridCol w:w=\"1440\"/><w:gridCol w:w=\"5760\"/
><w:gridCol w:w=\"1440\"/></w:tblGrid><w:tr wsp:rsidR=\"00386746\"
wsp:rsidRPr=\"00386746\" wsp:rsidTr=
\"00386746\"><w:tblPrEx><w:tblCellMar><w:top w:w=\"0\" w:type=\"dxa\"/
><w:bottom w:w=\"0\" w:type=\"dxa\"/></w:tblCellMar></
w:tblPrEx><w:tc><w:tcPr><w:tcW w:w=\"1440\" w:type=\"dxa\"/></
w:tcPr><aml:annotation aml:id=\"0\" w:type=\"Word.Bookmark.Start\"
w:name=\"MyBookmark\"/><aml:annotation aml:id=\"0\" w:type=
\"Word.Bookmark.End\"/><w:p wsp:rsidR=\"00386746\" wsp:rsidRPr=
\"00386746\" wsp:rsidRDefault=\"00386746\" wsp:rsidP=
\"00386746\"><w:pPr><w:spacing w:after=\"120\"/><w:rPr><w:b/><w:i/
><w:sz w:val=\"20\"/><w:sz-cs w:val=\"20\"/></w:rPr></w:pPr><w:r
wsp:rsidRPr=\"00386746\"><w:rPr><w:b/><w:i/><w:sz w:val=\"20\"/><w:sz-
cs w:val=\"20\"/></w:rPr><w:t>ITEM</w:t></w:r></w:p></
w:tc><w:tc><w:tcPr><w:tcW w:w=\"5760\" w:type=\"dxa\"/></w:tcPr><w:p
wsp:rsidR=\"00386746\" wsp:rsidRPr=\"00386746\" wsp:rsidRDefault=
\"00386746\" wsp:rsidP=\"00386746\"><w:pPr><w:spacing w:after=\"120\"/
><w:rPr><w:b/><w:i/><w:sz w:val=\"20\"/><w:sz-cs w:val=\"20\"/></
w:rPr></w:pPr><w:r wsp:rsidRPr=\"00386746\"><w:rPr><w:b/><w:i/><w:sz
w:val=\"20\"/><w:sz-cs w:val=\"20\"/></w:rPr><w:t>DESCRIPTION</w:t></
w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"1440\" w:type=\"dxa\"/></
w:tcPr><w:p wsp:rsidR=\"00386746\" wsp:rsidRPr=\"00386746\"
wsp:rsidRDefault=\"00386746\" wsp:rsidP=\"00386746\"><w:pPr><w:spacing
w:after=\"120\"/><w:rPr><w:b/><w:i/><w:sz w:val=\"20\"/><w:sz-cs w:val=
\"20\"/></w:rPr></w:pPr><w:r wsp:rsidRPr=\"00386746\"><w:rPr><w:b/
><w:i/><w:sz w:val=\"20\"/><w:sz-cs w:val=\"20\"/></w:rPr><w:t>COST</
w:t></w:r></w:p></w:tc></w:tr>";
int NumRows = noOfItems + 1;
int r;
for (r = 2; r <= noOfItems + 1; r++)
{
int actCount = r - 1;
int dumCount = r - 2;
DataRow row = dtQuoteItems.Rows[dumCount];
string strRow = "<w:tr wsp:rsidR=\"00386746\"
wsp:rsidTr=\"00386746\"><w:tblPrEx><w:tblCellMar><w:top w:w=\"0\"
w:type=\"dxa\"/><w:bottom w:w=\"0\" w:type=\"dxa\"/></w:tblCellMar></
w:tblPrEx><w:tc><w:tcPr><w:tcW w:w=\"1440\" w:type=\"dxa\"/></
w:tcPr><w:p wsp:rsidR=\"00386746\" wsp:rsidRDefault=\"00386746\"
wsp:rsidP=\"00386746\"><w:pPr><w:spacing w:after=\"120\"/><w:rPr><w:sz
w:val=\"20\"/><w:sz-cs w:val=\"20\"/></w:rPr></w:pPr><w:r><w:rPr><w:sz
w:val=\"20\"/><w:sz-cs w:val=\"20\"/></w:rPr><w:t>";
strRow += actCount.ToString();
strRow += "</w:t></w:r></w:p></
w:tc><w:tc><w:tcPr><w:tcW w:w=\"5760\" w:type=\"dxa\"/></w:tcPr><w:p
wsp:rsidR=\"00386746\" wsp:rsidRDefault=\"00386746\" wsp:rsidP=
\"00386746\"><w:pPr><w:spacing w:after=\"120\"/><w:rPr><w:sz w:val=
\"20\"/><w:sz-cs w:val=\"20\"/></w:rPr></w:pPr><w:r><w:rPr><w:sz w:val=
\"20\"/><w:sz-cs w:val=\"20\"/></w:rPr><w:t>";
strRow += row["QuoteItemDescription"].ToString();
strRow += "</w:t></w:r></w:p></
w:tc><w:tc><w:tcPr><w:tcW w:w=\"1440\" w:type=\"dxa\"/></w:tcPr><w:p
wsp:rsidR=\"00386746\" wsp:rsidRDefault=\"00386746\" wsp:rsidP=
\"00386746\"><w:pPr><w:spacing w:after=\"120\"/><w:rPr><w:sz w:val=
\"20\"/><w:sz-cs w:val=\"20\"/></w:rPr></w:pPr><w:r><w:rPr><w:sz w:val=
\"20\"/><w:sz-cs w:val=\"20\"/></w:rPr><w:t>";
strRow += String.Format("{0:c}",
row["QuoteItemCost"]);
strRow += "</w:t></w:r></w:p></w:tc></w:tr>";
sVal +=strRow;
}
}
sVal += "</w:tbl>";
strTag = "«ITEMTABLE»";
rptxml = rptxml.Replace(strTag, sVal);
On 29 Oct, 14:39, stapes <[email protected]> wrote:
> You have made me laugh heartily if nothing else. I love the 'Let me
> Google that for you' link.Thanks for reading material.
>
> On 29 Oct, 15:26, Stephen Russell <[email protected]> wrote:
>
>
>
> > On Fri, Oct 29, 2010 at 9:14 AM, stapes <[email protected]> wrote:
> > > Read up on XSLT - I wouldn't know where to start. Finding any info
> > > whatsoever is not easy. I find Microsofts own info particularly
> > > useless - never shows you any proper examples of how to use stuff.
> > > Instead, their technical pages are mostly useless examples of
> > > newspeak. Personally, I find the forum approach the best.
>
> > ----------------------
>
> > If this was easy everyone would be doing it.
>
> > <http://www.lmgtfy.com/?q=C%23+XML+XSLT+example> Bad Steve!
>
> > <http://www.xmlfiles.com/articles/cynthia/xslt/default.asp>
>
> > KISS version here:http://www.w3schools.com/xsl/
>
> > Use that Try it yourself button.
>
> > Now that you see it you have to adapt to the M$ containers to do the
> > same thing. First you have to know what is going on they you can
> > tweak it.
>
> > --
> > Stephen Russell
>
> > Sr. Production Systems Programmer
> > CIMSgts
>
> > 901.246-0159 cell- Hide quoted text -
>
> - Show quoted text -