2
votes

I have ssrs report viewer url and tried directly convert to pdf :

http://someIP/Reports_Server/Pages/Report.aspx?ItemPath=%2fReport+Folder%2fReport+Name&Parameter=parametervalue&rs:Command=Render&rs:Format=PDF

If I tried to access it in browser, it did not render to pdf, and parameter not passed. I did something like this in mvc 5 :

 public ActionResult GetPdfReport()
    {
        NetworkCredential nwc = new NetworkCredential("username", "password");
        WebClient client = new WebClient();
        client.Credentials = nwc;

        string reportURL = "http://someIP/Reports_Server/Pages/Report.aspx?ItemPath=%2fReport+Folder%2fReport+Name&Parameter=parametervalue&rs:Command=Render&rs:Format=PDF";


        return File(client.DownloadData(reportURL), "application/pdf", "filename.pdf");
    }

Anyone any idea?

1

1 Answers

0
votes

I've successfully got PDF report from our SSRS system via browser URL. I used next URL:

http://serverAddress/reportServer?/report_folder/report_name/&rs:Command=Render&rs:Format=PDF&rc:Toolbar=false&rc:Parameters=false&client_id=107

where client_id is report parameter.