0

I need to generate multiple separate Word documents from one table-valued function call.

The function is located on a SQL Server 2008R2 server, and I have Visual Studio 2008 with SP1, Visual Studio 2010, and Business Intelligence Design Studio (BIDS).

So far, I can pretty easily get this setup to show me a nice Word document in the "preview" view of the report's designer.

What I need is to generate a separate Word document for each row of data in the report. The document is about 5 pages long, and - as usual - I am very pressed for time. I do not want to go the XML/XSLT route with custom C#/VB code unless I have to. Does anyone know if there is a relatively simple way to tell the report designer in BIDS to generate a different document for each row of data in the dataset? If so, do you also happen to know how I might apply a naming convention to the generated documents?

Thank you very much!!!

Dan M
  • 15
  • 3
  • How pressed for time are you? It seems like you could spend all of the time you are spending on trying to figure this out on creating the various documents. I would just add a page break between the rows of data and then you could easily copy out each page. – Neil Dec 14 '12 at 16:58
  • Thanks for the suggestion Neil. However, each copy of the document will be 5 pages. Some days there may be 20 rows of data, yielding a single 100-page document that would have to be copied and pasted 20 times. Definitely in a hurry, but I can't burden the user that way. I tried doing some grouping work by grouping on 1, 2, or all returned columns and then using page breaks between them but that did not pan out either. If anyone knows specifically how this would/should be done in BIDS/SSRS, I'd really appreciate hearing about it! – Dan M Dec 14 '12 at 20:17
  • Can you give us some more background about the situation? For example, what data is in the report? There might be a completely different way to handle the issue. – Neil Dec 14 '12 at 21:47
  • Due to the time constraint, we have chosen to just write VBA macros in a Macro-enabled Word document that leverage Content Controls in a separate Macro-enabled Word template. Ugh, VBA isn't my language of choice, and Office documents are not my platform of choice, but such is the life of a rapid developer :( Thanks again Neil! – Dan M Dec 15 '12 at 17:56

1 Answers1

0

In full SSRS with a Report Manager or SharePoint portal this is called "Data Driven Subscriptions" ref: http://msdn.microsoft.com/en-us/library/ms159150.aspx

It sounds like you are building a ReportViewer solution, in which case you are pretty much on your own. You probably need to add a parameter to your report to get "a copy" of 5 pages from each execution, and then loop through the required executions in your code.

Good luck! Mike

Mike Honey
  • 14,523
  • 1
  • 24
  • 40