How to get report parameters in default constructor

2 posts, 0 answers
  1. Terry
    Terry avatar
    14 posts
    Member since:
    Oct 2012

    Posted 11 Sep Link to this post

    Does anyone know how to get the value of report parameters in the default report constructor? I am using Telerik.ReportViewer.Html5.WebForms. You used to be able to get it by the example below but this no longer works. Is there another way to get a reference to a parameter within the default constructor?

     

        public partial class Report1 : Telerik.Reporting.Report
        {
            public Report1(int month)
            {
                //
                // Required for telerik Reporting designer support
                //
                InitializeComponent();

                //
                // TODO: Add any constructor code after InitializeComponent call
                //

     

               int MonthParam = month;
            }
        }

  2. Neli
    Admin
    Neli avatar
    190 posts

    Posted 16 Sep Link to this post

    Hi Terry,

    If I understood correctly, you would like to set the value of the report parameter through the report's constructor. Note that the report needs to have a parameterless constructor in order to be opened in the Visual Studio designer or passed to the TypeReportSource.

    If you need to pass the parameter in the report constructor, you will have to wrap it in an InstanceReportSource when passing it to the Reporting engine. Note that we recommend to use Report with a parameterless constructor and pass the Report Parameter values through the Parameters collection of the Report Source.

    Regards,
    Neli
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top