Problem sending report via URL

  • Hoping a guru on this site can help me with this problem.

    I'm trying to send a report using sp_send_dbmail via a URL in the file attachments.

    Error message output is

    Msg 22051, Level 16, State 1, Line 0

    Attachment file [insert URL below] is invalid.

    If I take the URL that is used in the attachment below and paste it into a browser the report is output as pdf, so there's no problem with that piece.

    I've tested the ability to send attachments, no problems there with a simple text file.

    I've been hunting for a while for the issue and haven't had much luck, I think it's permissions related but I don't know where. I'm told the SQL server service domain account and the SQL reporting service domain account have permissions re SMTP, but other than that I'm completely stumped as to where to look.

    I'm calling it as follows... (obviously with things filled in appropriately)

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = 'DatabaseMail',

    @recipients = 'someone@domain.com',

    @subject = 'Report Name',

    @Body = 'Email Body',

    @body_format = 'HTML',

    @file_attachments = 'http://ServerName/reportserver?%2fReportFolder%2fReport+Name&rs:Format=PDF&Parameter=34'

    I'll continue on my hunt to figure this out, however hoping to get a head start if someone has had this issue and resolved it, or can spot something wrong above.

    Cheers

Viewing 0 posts

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