We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Internal Report Parameters Dotnet core

Thread ID:

Created:

Updated:

Platform:

Replies:

146625 Aug 11,2019 05:56 PM UTC Aug 12,2019 10:49 AM UTC Report Platform 4
loading
Tags: General
Yoab Youssoufou
Asked On August 11, 2019 06:00 PM UTC

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:

 
   
      Integer
     
      true
   

 


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.






Yoab Youssoufou
Replied On August 11, 2019 06:06 PM UTC

The code did not render well in my text above so I have attached screenshots of my view, RDL file and WebApi.
Thanks

Attachment: ReportParamError_f2af2fa.7z

Vinoth Srinivasan [Syncfusion]
Replied On August 12, 2019 06:09 AM UTC

Hi Yoab, 

We have validated your code snippet and suspect that you are not passing value for the hidden parameter from code behind properly. We suggest you to refer the below help documentation for passing parameters from code behind. 


If you still have any issue then please share your RDL file with us, it will be helpful for us in further validation. 

Regards, 
Vinoth S. 


Yoab Youssoufou
Replied On August 12, 2019 09:03 AM UTC

Thanks. It's ok now.

Vinoth Srinivasan [Syncfusion]
Replied On August 12, 2019 10:49 AM UTC

Hi Yoab, 

Thanks for your update. Please let us know if you require further assistance on this. 

Regards, 
Vinoth S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon