alanjuden / MvcReportViewer

Custom Report Viewer control to replace MS Report Viewer on MVC projects (also works on .NET Core as a Report Viewer).
MIT License
172 stars 108 forks source link

Report failed to load, check report parameters #42

Open k11k2 opened 7 years ago

k11k2 commented 7 years ago

I'm very new to this, Strictly followed your sample and end up with above error and in console: http://localhost:3000/Report/ViewReportPage/?reportPath=%2FMoney.ReportServer%2FSalesOrder&page=1& 404 not found

what I'm missing here I need to host SSRS project in to server ? it can't deal with local .rdl files ? or may I missing something?. Please provide documentation or else guide me to complete my job.

k11k2 commented 7 years ago

@deanilvincent I don't need to send any parameters right now, still I'm getting this issue, did I misunderstand any thing?

deanilvincent commented 7 years ago

Can you post your exact codes? @AlwaysAbhl001

k11k2 commented 7 years ago
public class ReportController : AlanJuden.MvcReportViewer.ReportController
    {
        protected override ICredentials NetworkCredentials
        {
            get
            {
                return System.Net.CredentialCache.DefaultNetworkCredentials;
            }
        }

        protected override string ReportServerUrl
        {
            get
            {

                return "http://localhost/ReportServer";
            }
        }
        [HttpGet]
        public ActionResult MyReport()
        {
            var model = this.GetReportViewerModel(Request);
            model.ReportPath = "/Money.ReportServer/SalesOrder";

            return View("ReportViewer", model);

        }

    }

And ReportViewer.cshtml view looks same as author mention. Url of my SSRS project looks like http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fMoney.ReportServer%2fSalesOrder&rs:Command=Render
@deanilvincent let me know, for any further information.

alanjuden commented 7 years ago

@AlwaysAbhl001, do you have a directory on your report server called "Money.ReportServer" as indicated by your ReportPath?

k11k2 commented 7 years ago

Yes. -> Money.ReportServer/SalesOrder. If I deploy my SSRS project firstly it shows directory -Money.ReportServer after click on it moves to childtree - SalesOrder.

k11k2 commented 7 years ago

If I mention wrong Directory it throwing

FaultException: System.Web.Services.Protocols.SoapException: The item '/Reports/SalesOrder' cannot be found. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ItemNotFoundException: The item '/Reports/SalesOrder' cannot be found.
at Microsoft.ReportingServices.Library.ReportingService2005Impl.GetReportParameters(String Report, String HistoryID, Boolean ForRendering, ParameterValue[] Values, DataSourceCredentials[] Credentials, ParameterInfoCollection& Parameters)
at Microsoft.ReportingServices.WebServer.ReportingService2005.GetReportParameters(String Report, String HistoryID, Boolean ForRendering, ParameterValue[] Values, DataSourceCredentials[] Credentials, ReportParameter[]& Parameters)

so mentioned Report Path is absolutely right one then what else stopping me @alanjuden ?

FYI: AdventuresWorks2008R2 db and my web application is aspnetcore2.0 webappMVC.

kanichi123 commented 5 years ago

I have exactly the same issue like this, do you have any update on solutions?

jmarti326 commented 5 years ago

You can check if the library is also looking at internal parameters not only the ones the user sends. In my case, I saw that if I manually removed the internal parameters, the viewer worked like a charm.

kanichi123 commented 5 years ago

yep I don't have any internal parameters. I tried many time with different report, it's not even work with the sample. Do you mean that I need to update the code inside the library also?

jmarti326 commented 5 years ago

Yes, this does make you do changes to the library. :(

mpanezai commented 5 years ago

I have came across the same error "Report failed to load. check "Report parameters... ". in my case, I have two reports in Report Server (SQL Server 2012 R2), both with two parameters.. 1. Report with local/static content and the two parameters which takes values from user (asp.net web core 2.2 MVC) and display them on report which works fine, but the other one, 2. Report with its Dataset (stored procedure) which takes two parameter and pass it on to SP to fetch data from database. No matter how the Params are configured (hidden, visible) in the report the error noted above keeps showing. on inspecting the calls in browsers Inspect: image

samirbanjanovic commented 5 years ago

I am having this issue on a remote server. And it comes down to how the report URL is formatted in jquery. In our case the MVC app is hosted under URL that's similar to company.org/ReportViewer, but when the report comes back the jquery relies on uri to be company.org/Report/Some-Report-Name which is why we're getting 404.

We fixed it by switching to absolute uri instead of relative

var pageRootPath = document.location.href.slice(0, document.location.href.indexOf('/Report?')); . . . $.get(pageRootPath+ "/Report/FindStringInReport" . . .