Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rendering word reports using XML and XSL to generate Word XML

12 views
Skip to first unread message

Safal

unread,
May 11, 2010, 10:45:01 PM5/11/10
to
We have a requirement where-in we need to export an SSRS 2005 generated
report in word document.
Since this is not available out of the box the solution chosen was XSLT as
described in this document -
http://jagbarcelo.blogspot.com/2006/07/reporting-services-ms-word-format-doc.html (Rendering word reports using XML and XSL )

With this approach there still are certain blocking issues like

1/ Display rich text - Suppose we have HTML tags in the text they are thrown
out on the word document as text instead of rich text

2/ Charts - Export a chart into the word file (bar graphs)

3/ Tables - Dynamic table generation based on the data & coloring of cells
based on conditions.

The redering of all this needs to be on a word document and not HTML. Any
advices please let me know.

Peter Jamieson

unread,
May 14, 2010, 7:36:04 AM5/14/10
to

I wonder if you have come across

http://www.aspose.com/categories/ssrs-rendering-extensions/aspose.words-for-reporting-services/default.aspx

or similar products? It would at least handle export to various
potentially useful formats. (I've never used it so cannot say whether it
would meet your needs or not).

I would guess it would not handle your (1) and (3), but maybe it would
do (2).

Doing either (1) or (3) in the XML would, I think, be quite difficult. I
think it would probably be easier to do both by automating Word. If I
had to do them in the XML...

For (1) I would probably proceed as follows
a. decide which HTML formatting I was going to attempt to preserve
b. work out a way to detect the relevant tags and discard the rest
c. "normalise" the remaining HTML, by which I mean
- ensure that every tag has a closing tag
- add tagging as necessary so that there is no overlapping tagging,
and so that, for example, formatting that spans paragraphs is terminated
at the end of one paragraph and restarted at the beginning of the next
c. I think at that point, you could probably successfully split up the
relevant WordProcessingML runs <w:r></w:r> into shorter runs that
correspond to the formatting transitions, and apply the necessary
formatting to the run.
d. see if there are situation where that simply won't work and decide
what to do.

For (3) the key question is whether the info. you need to decide what
formatting to apply is in the output from SSRS, or whether you would
have to retrieve it from the database and match it up, cell by cell. I
haven't looked at the XML necessary to apply colours to cells, but I
would imagine that this one might be a bit easier than (1).

Just my 2-cents' worth.

Peter Jamieson

http://tips.pjmsn.me.uk

On 12/05/2010 03:45, Safal wrote:
> We have a requirement where-in we need to export an SSRS 2005 generated
> report in word document.
> Since this is not available out of the box the solution chosen was XSLT as
> described in this document -
> http://jagbarcelo.blogspot.com/2006/07/reporting-services-ms-word-format-doc.html (Rendering word reports using XML and XSL )
>
> With this approach there still are certain blocking issues like
>
> 1/ Display rich text - Suppose we have HTML tags in the text they are thrown
> out on the word document as text instead of rich text
>
> 2/ Charts - Export a chart into the word file (bar graphs)
>

> 3/ Tables - Dynamic table generation based on the data& coloring of cells

0 new messages