As a requirement, I have to check for a certain condition on some data in the database, if the condition is true, then I have to create a pdf report and store it on a table.

I have everything set up as a T-SQL SP except the pdf report part.

Is there anyway to execute an SSRS Report, export it to PDF and store the pdf in a varbinary column directly from T-SQL ?

Otherwise the only solution would be creating a Windows Service to do this (I Know how to do this but the T-SQL way would give me more flexibility).


migrated from stackoverflow.com Sep 2 '12 at 3:04

This question came from our site for professional and enthusiast programmers.

  • There are code examples around (geekswithblogs.net/bsherwin/archive/2007/04/29/112094.aspx) that show you how to render a report directly to a PDF. I imagine you could use that, store the file in a temp location and then insert the the file into the DB. – D.S. Aug 31 '12 at 17:40
  • I Know how to do that, i wanted to know if i could do it using t-sql for it's flexibility. Thanks – Calbertoferreira Sep 1 '12 at 9:52

You should be able to write any sort of code in .Net and connect it into SQL Server. See http://www.codeproject.com/Articles/19954/Execute-NET-Code-under-SQL-Server-2005 for an example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.