Exporting SSRS Report to PDF in MVC Action

前端 未结 2 527
暗喜
暗喜 2020-12-31 22:41

Yes , I want to Export SSRS Report to the PDF and Return it from my action, I do not have any Report Viewer.Please Suggest me how can i achieve this. so far

相关标签:
2条回答
  • 2020-12-31 23:02

    try not specify the domain like this:

    NetworkCredential nwc = new NetworkCredential("username", "password");
    
    0 讨论(0)
  • 2020-12-31 23:10

    I Corrected the Above Code and now its Working

        public ActionResult GetPdfReport()
        {
            NetworkCredential nwc = new NetworkCredential("username", "password");
            WebClient client = new WebClient();
            client.Credentials = nwc;
            string reportURL = "http://someIp/ReportServer/?%2fReportProjectName/ReportName&rs:Command=Render&rs:Format=PDF";
            return File(client.DownloadData(reportURL), "application/pdf");
        }
    

    i do not found any other alternative than this to export SSRS Report in MVC without using ReportViewer.

    0 讨论(0)
提交回复
热议问题