Question

I am generating a Word document using the OpenXml SDK 2.0 and everything in that respect is fine. The document has a lot of tables with multi-row table headers and everything looks exactly the way it should.

I am passing this document through the word automation service in Sharepoint 2010 Enterprise and the service returns a converted file. Sometimes the file format is the same as the input format (Docx->Docx) as I use the service to refresh the table of contents, but most conversions are to PDF.

My problem is that the document returned does not contain the same headers as the source document. If I look at the OpenXml of the document, the rows do not have the TableHeader property but they do in the source.

Has anyone experienced this before? What can I do to fix this as I can find very little about WAS and how it works. We have invested a fair bit of time into developing this and do not want to have to resort to a third party component.

Was it helpful?

Solution

This is actually a defect in Word Automation Services and how it handles multi-row headers. I got around the issue by explicitly setting the colours in the header rows so that they look like headers, but are not.

This means that if the table spans across multiple pages then the header won't be repeated, but it's the lesser of two evils.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top