0

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">

enter image description here

Sourav
  • 3,025
  • 2
  • 13
  • 29
  • Maybe you can refer to the similar problem [SSRS report definition is newer than Server](https://stackoverflow.com/questions/38902037/ssrs-report-definition-is-newer-than-server). – Jack J Jun Oct 19 '20 at 07:26

1 Answers1

0

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.

Athanasios Kataras
  • 25,191
  • 4
  • 32
  • 61
  • the array starts with index 0 , that's why 1 declared it as [1] to fit two parameters....any way that's not the main problem, thank you anyway. – Ali Rida Hussein Oct 18 '20 at 08:40