2. Also I was thinking that I could embed some of the of the word
features
in the sql report report servcie xml to create an automatic table of contents
in word.
If you look at the links:
The basic problem is that the built-in facility in SSRS only lets you
generate Word format reports as .doc format, and .doc is not XML-based.
So the rendering component that generates .doc format would have to
understand the WordProcessingML/WordML that you inserted and be able to
convert it into the corresponding features in the .doc binary format
(e.g. insert a { ToC } field that would then generate a ToC) in Word. I
don't know as an absolute certainty but I would be very surprised if the
..doc rendering component can do that.
AFAIK Microsoft has not yet produced a rendering extension to output
..docx (curious, given their commitment to the new format, but perhaps
they are leaving such things to third parties - there is for example the
pay-for product by Aspose (see
http://www.aspose.com/categories/ss...ose.words-for-reporting-services/default.aspx
) and there may well be others. However, even then, I can't tell you
whether or not you can insert WordProcessing ML that the Aspose
extension would pass through into your .docx. That's one reason why
you'd be better off asking in an SRSS-specific group.
1. You mentioned automate 'word' in your previous e-mail message. Can you
explain what you mean by automate.
The Word application is an object that can be programmed using "COM
Automation". Maybe the idea that you can "script" Word might be more
familiar to you? In any case, the idea is that you can start a copy of
Word, get it to open or create a document, get it to insert text, and in
fact do the vast majority of things that a user could do using Word's
user interface. You can automate Word using any language/programming
system that knows how to work with COM automation (e.g. VB or VBA),
including .NET languages such as C# and VB.NET. With .NET you can also
use the VSTO library (not really sure how to describe it) to control Word.
[The other way to create or modify Word documents is to do it directly
by generating the necessary XML files and a .docx container (basically a
ZIP file) to hold them. At present the Open XML SDK is probably the way
to go if you need to do that - see, e.g.:
http://msdn.microsoft.com/en-us/library/bb448854(office.14).aspx
http://msdn.microsoft.com/en-us/office/aa905545.aspx
If you don't have programing resource available that's probably quite an
expensive way to go.
The following is probably rather too much detail right now, but in
addition...when it comes to creating things such as Tables of Content,
it's worth bearing in mind that with a typical ToC that lists a page
number for each part of the document, /something/ has to be able to work
out which page a particular piece of content is actually on. Although
you could obviously generate your own ToC based on your knowledge of
where each item would be, it would be a "static" ToC. That might be
perfectly adequate for your needs, but such a ToC would not easily be
corrected if, for example, the user needed to reformat an A4 document
for printing on US Letter paper, or the user needed to make other
changes that would result in a repagination. In other words, inserting a
ToC field is probably still the most versatile way of generating a ToC,
but then at some point you're likely to have to ensure that Word
actually "updates" the ToC field, and that would typically require that
a user knew they had to do that, or require that you automated Word in
some way. i.e. the "direct generation" approach to constructing Word
documents does not necessarily do /everything/ you need.
Peter Jamieson
http://tips.pjmsn.me.uk