0

I am using SQL Server Reporting Service 2005(SSRS 2005) to export report to Excel and PDF and VS2008. But now i want an option to Export to Word also, but it is not possible in SSRS 2005 report that i came to know after googling. Here problem is that I CAN'T USE SSRS 2008 REPORT. So i thought that i will follow the steps as....

-- Export to Word

1. Export to PDF

2. Convert that PDF to Word document

Even after so much of googling i didn't got the proper answer. I told once and even telling that i can't use any third party tools so don't give me wrong path.

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
iVad
  • 563
  • 2
  • 4
  • 13

1 Answers1

0

There are many fundamental differences between PDF and Word making the approach you want highly undesirable as a general workflow. I'll give just one example: PDF typically does not store information about document structure - sentences, paragraphs, columns, tables... All it stores is the actual text at certain locations at a page. Word of course does have those concepts.

Is it possible to do what you want? Yes, to some extent. In the general case with guesswork and approximation. If you know which information you want to convert it might be possible to search for it in the PDF file generated by SSRS and then generate a Word file out of it. However, if SSRS allows export to text, XML, RTF or any other structure based file format (however slightly structure based), you'd have a much easier time.

If you insist on doing what you suggest here, you would have to:

1) Write code to take the PDF exported from SSRS and interpret it (find the textual content you want)

2) Recreate the necessary structural information from that information (what are paragraphs, where and what are the tables, what's the formatting etc...)

3) Write that into a file Word can read (or create a new Word document directly using automation).

This would be a considerable amount of work, but you have all of the necessary information as the PDF specification is freely downloadable from the Adobe web site and it contains all of the information you need.

David van Driessche
  • 6,602
  • 2
  • 28
  • 41
  • Thanks David but i think this is lengthy process and will take a much more time and reading each paragraphs, tables, graphs is tedious job. and i don't even know whether the all reports are of same format. It may possible that some of the report may have graphs and some of have tables, images and contents. So any other way is there for this issue? – iVad Jul 30 '13 at 06:11
  • Well, using third-party tools might make it a shorter path :-) Other than that, like I said have a look at whether you can get the information out in XML or another textual format. That would be much easier to read and put into a Word file than trying to go over PDF (it's really the PDF intermediate step that is adding a lot to the complexity / time for your procedure...). – David van Driessche Jul 30 '13 at 06:21
  • Ya David, i can generate XML from SSRS 2005 report, even the question is as raised, then How can i convert XML to Word? Can you give me a sample code for converting XML to Word? – iVad Jul 30 '13 at 06:29
  • Have a look at this question and answer to get you started: http://stackoverflow.com/questions/4686809/creating-a-word-document-using-xml-and-c-sharp/4687540#4687540 – David van Driessche Jul 30 '13 at 06:43