Rendering reports via Url Access

Querying Reporting Services for a report couldn't be easier with Url Access (  For example:

String report = "/Folder/Report";
String filename = "Report.pdf";
List<KeyValuePair<String, String>> parameters =
    new List<KeyValuePair<String, String>>();
parameters.Add(new KeyValuePair<String, String>("Param1", "Value1"));
parameters.Add(new KeyValuePair<String, String>("Param2:isnull", "true"));

System.Net.WebClient client = new System.Net.WebClient();
client.Credentials = System.Net.CredentialCache.DefaultCredentials;
String url = "http://localhost/reportserver?" +
    report + "&rs:Command=Render&rs:Format=PDF";
foreach (KeyValuePair<String, String> parameter in parameters)
    url += "&" + parameter.Key + "=" + parameter.Value;
client.DownloadFile(new Uri(url), filename);

Comments (3)
  1. Why is this post not showing up in your RSS feed? Very odd.

  2. This problem should now be resolved.  Thanks.

Comments are closed.

Skip to main content