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