2005 Database mail query results sent as formatted PDF

  • I have a need to send out RMA notifications to customers via SQL 2005 database mail. I need the results of the query we are running to be formatted as a PDF attachment, the RMA form.

    We are doing something similar already with shipping notifications however those results are being returned formatted in the message body in HTML.

    Is there a way to generate the results to PDF?

    Thanks!

    Rick

  • Do you have reporting services set up on your network anywhere that could access the server? If so, it is incredibly easy to create a basic report that renders out to PDF and sends you an email. That would be the way I would do it, if I were you.

    To do it via database mail, I would guess that you would have to pre-create the pdf and then call sp_send_dbmail with that pdf attached. To me, this would be a less simple task than going through SSRS but I am sure it is quite doable as well.

  • Thanks for the advice. What we are trying to do here is a bit different. We have an ERP system in which sales orders are entered. We have a Job that is scheduled to send out emails based on that days sales orders, each email to different customer with their order and shipping information in it, etc. That notification is the result of a query formatted in XML\HTML in the message body.

    We are looking to do something similar here for returns but we want the results of the query formatted in a PDF attachment. I have all of the info that I think I need except getting the results in a PDF attachment.

    Thanks.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply