Several methods are provided at MSDN. I have used URL access often for quick simple PDF buttons in an ASP .NET app.
Here's a quick hack bit of code doing this. It could be cleaned up to use integrated authentication, and there are many ways you could store the report name. (I cut and pasted this from some old code I had that would store a report to a database and then later could return that from the db.
// First read in the report into memory.
string strReportUser = "RSUserName";
string strReportUserPW = "MySecretPassword";
string strReportUserDomain = "DomainName";
string sTargetURL = "http://SqlServer/ReportServer?" +
HttpWebRequest req =
(HttpWebRequest)WebRequest.Create( sTargetURL );
req.PreAuthenticate = true;
req.Credentials = new System.Net.NetworkCredential(
HttpWebResponse HttpWResp = (HttpWebResponse)req.GetResponse();
Stream fStream = HttpWResp.GetResponseStream();
//Now turn around and send this as the response..
byte fileBytes = ReadFully( fStream );
// Could save to a database or file here as well.
Response.ContentType = "application/pdf";
"attachment; filename=\"Report For " +
ParamValue + ".pdf\"" );
Response.BinaryWrite( fileBytes );
public static byte ReadFully( Stream input )
using ( MemoryStream ms = new MemoryStream() )
input.CopyTo( ms );