Hello,
I have successfully integrated Report Dedesigner and Report Viewer in Asp.net Core. I am testing a very simple report and all works well without parameters. With parameters when the visibility is set to true it works and I can select the parameter value form, a combobox at runtime. My problem is that I want to supply the parameter dynamically when someone clicks a link for example, i tried "hidden" parameter but I get an error "Hidden report parameters ProcessId is missing a value. Report cannot be rendered"
my parameter is called "ProcessId" it is properly defined in the RDL like so:
my view is defined as so:
and finally in my WebAPI i have the following code:
public void OnReportLoaded(ReportViewerOptions reportOption)
{
var parameters = new List();
if (DefaultParam != null)
{
parameters = JsonConvert.DeserializeObject>(DefaultParam);
}
if (parameters != null && parameters.Count > 0)
{
reportOption.ReportModel.DataSources.Clear();
reportOption.ReportModel.DataSources.Add(new Syncfusion.Reporting.Web.ReportDataSource { Name = "ProcessId", Value = 91 });
}
}
where I harcoded the ProcessId to 91 for testing purposes, I will likely use a session variable in real life. Despite this I still get the error message above about hidden report parameter missing, Please what am I missing? I repeat report without parameters is ok and with visible parameters ius also ok.
Thanks in advance for your usual prompt response.