Friday, March 30, 2012

Output a report directly to PDF?

Hey everyone, does anyonw know how to output a report directly to PDF?
That is, without passing any parameters, but defaulted in the report
itslef. So a user would not have a choice to view it in the report
manager?I think the only way to do this is to have your own frontend. No way to
configure the server to do this (I think it would be a bad idea overal, PDFs
are much much slower and more compute intensive). I agree for some reports
it would be nice to mark it as rendering only in a certain format. But, no
capability for that exists.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<Daniel.P.Lyonnais@.lmco.com> wrote in message
news:1131047107.559743.200760@.f14g2000cwb.googlegroups.com...
> Hey everyone, does anyonw know how to output a report directly to PDF?
> That is, without passing any parameters, but defaulted in the report
> itslef. So a user would not have a choice to view it in the report
> manager?
>|||Daniel;
You can simply render the report as a PDF file as shown below. Will that do
what you need?
Wayne
=======================================Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim rs1 As New Wedding.rs.ReportingService
rs1.Credentials = New System.Net.NetworkCredential("myServer", "tmyPW", "")
Dim results As Byte(), image As Byte()
Dim streamids As String(), streamid As String
' Render the report to HTML4.0
results = rs1.Render(Session("ReportPath"), "PDF", _
Nothing,
"<DeviceInfo><StreamRoot>/WebApplication1/</StreamRoot></DeviceInfo>",
Nothing, _
Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, streamids)
Response.BinaryWrite(results)
End Sub
<Daniel.P.Lyonnais@.lmco.com> wrote in message
news:1131047107.559743.200760@.f14g2000cwb.googlegroups.com...
> Hey everyone, does anyonw know how to output a report directly to PDF?
> That is, without passing any parameters, but defaulted in the report
> itslef. So a user would not have a choice to view it in the report
> manager?
>sql

No comments:

Post a Comment