I want to programmatically pass in some parameters, generate
a report, export this report to PDF, and pop up adobe acrobat reader in a web
browser in one click while naming the PDF file exactly as I like, including
its path. I currently do this easily with Crystal Reports in one click, but
I need to see if its feasible in RS.
In crystal I use an ASP.net page that does all of this for me. I declare the
report, get the parameters, fill them, set up the username/password for the
database, set a name for the file, and set the export options, and then
generate the report.
If I could get some direction as to how to do some of this stuff, it would
be great =) We are thinking that while its not pretty we are going to use the
URL method if possible to do this stuff, because we already have a custom web
app in place, and no need for a shell etc. We just need a web page that can
do this for us upon hitting submit.
Again, any direction you can offer would be great
TIAHi Pinolian:
From ASP.NET you code access the report server with URL access and the
WebClient or WebRequest classes. Once you have the file pulled down to
the ASP.NET application you could stream the file to the client by
setting the content disposition header and using Response.BinaryWrite.
Some sample code would look like this:
byte[] response;
string url = "http://s/reportserver?Report&rs:Format=PDF";
using(WebClient webClient = new WebClient())
{
webClient.Credentials = CredentialCache.DefaultCredentials;
response = webClient.DownloadData(url);
}
Response.ContentType="application/pdf";
Response.AddHeader(
"content-disposition",
"attachment; filename=MyPDF.PDF"
);
Response.BinaryWrite(response);
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Tue, 19 Oct 2004 13:59:01 -0700, "Pinolian"
<Pinolian@.discussions.microsoft.com> wrote:
> I want to programmatically pass in some parameters, generate
>a report, export this report to PDF, and pop up adobe acrobat reader in a web
>browser in one click while naming the PDF file exactly as I like, including
>its path. I currently do this easily with Crystal Reports in one click, but
>I need to see if its feasible in RS.
>In crystal I use an ASP.net page that does all of this for me. I declare the
>report, get the parameters, fill them, set up the username/password for the
>database, set a name for the file, and set the export options, and then
>generate the report.
>If I could get some direction as to how to do some of this stuff, it would
>be great =) We are thinking that while its not pretty we are going to use the
>URL method if possible to do this stuff, because we already have a custom web
>app in place, and no need for a shell etc. We just need a web page that can
>do this for us upon hitting submit.
>Again, any direction you can offer would be great
>TIA
No comments:
Post a Comment