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 : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Pass Parameters from code behind

Thread ID:

Created:

Updated:

Platform:

Replies:

131843 Jul 30,2017 06:15 PM UTC Jul 31,2017 05:06 PM UTC WPF 3
loading
Tags: ReportViewer
BELADEL ILYES ABDELRAZAK
Asked On July 30, 2017 06:15 PM UTC

Hello,
I am trying to pass parameters from user to report viewer with the following:

            ReportWindow RW = new ReportWindow();
            string reportPath = System.IO.Path.Combine(new DirectoryInfo("reports").FullName, "takrir-tarbawi16.rdl");
            RW.ReportViewerControl.ReportPath = reportPath;
            List<ReportParameter> parameters = new List<ReportParameter>();
            ReportParameter parameter = new ReportParameter();
            parameter.Name = "FactNum";
            parameter.DefaultValue.Values.Add("456654");
            parameters.Add(parameter);

            RW.ReportViewerControl.SetParameters(parameters);
            RW.ReportViewerControl.RefreshReport();
            RW.Show();

Now I have an issue in compiling this, the error compiler sent:
Severity Code Description Project File Line Suppression State
Error CS1503 Argument 1: cannot convert from 'System.Collections.Generic.List<Syncfusion.RDL.DOM.ReportParameter>' to 'System.Collections.Generic.IEnumerable<Syncfusion.Windows.Reports.ReportParameter>' TeacherReportWindow.xaml.cs 40 Active


BELADEL ILYES ABDELRAZAK
Replied On July 31, 2017 12:42 AM UTC

It turns out that I am using diffrent refernce in another name space, now the code solved just by adding:

using Syncfusion.Windows.Reports;


Vinoth Srinivasan [Syncfusion]
Replied On July 31, 2017 04:53 AM UTC

Hi BELADEL, 

Thanks for the update, we are glad that you have fixed the issue and please get back to us if you require any further assistance. 

Regards, 
Vinoth S. 


BELADEL ILYES ABDELRAZAK
Replied On July 31, 2017 05:06 PM UTC

It's my duty to do that, thanks.


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.

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

;