简体   繁体   中英

The report definition may have been created with a later version of Reporting Services, or contain content that is not well-formed or not valid

I'm trying to design an rdlc report viewer in an asp.net project, the report works if no parameters are set, but when I set the parameters the below error is displayed:

The definition of this report is not valid or supported by this version of Reporting Services. The report definition may have been created with a later version of Reporting Services, or contain content that is not well-formed or not valid based on Reporting Services schemas. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition' which cannot be upgraded.

It seems that the error is in the rdlc file version, anyone knows how to solve this ?

This is the code the report viewer page:

    if (!Page.IsPostBack)
    {
        var app = (Pcr.Models.Appointment)Session["app"];

        ReportParameter[] parameters = new ReportParameter[1];
    
        parameters[0] = new ReportParameter("FullName", app.Name);
        parameters[1] = new ReportParameter("PhoneNumber", app.PhoneNumber.ToString());

        ReportViewer1.LocalReport.SetParameters(parameters);
        ReportViewer1.LocalReport.DataSources.Clear();
        ReportViewer1.ShowParameterPrompts = false;
        ReportViewer1.ShowPromptAreaButton = false;

    }

And this is the report definition:

<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">

在此处输入图片说明

Try to fix this line. Your code will break as you need a table with two parameters, not one.

ReportParameter[] parameters = new ReportParameter[2];

Other than that, check the question here: SSRS report definition is newer than Server for more information on the specific error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM