Give the report parameter initial value from another passed parameter

6 posts, 0 answers
  1. Aya
    Aya avatar
    4 posts
    Member since:
    Aug 2016

    Posted 18 Aug Link to this post

    Hi All,

    I am trying to make parameter at report its initial value passed from the code as a parameter 

    when I set the value field in the "report parameter editor" = Parameters.param2.Value , the initial value became empty after running the report

    The type of 2 parameters is string , one has datasource and the other witch passed from code didn't have 

    any suggestion for solution??

     

  2. Katia
    Admin
    Katia avatar
    309 posts

    Posted 19 Aug Link to this post

    Hello Aya,

    Check if param2 parameter has a default value set - How to: Add Report Parameters.

    If the requirement is to implements cascading parameters you can review the approaches suggested in the following help articles:

    If the above information does not help please share more details how the parameters are configured - attach screenshots or send us a demo project in a support ticket.


    Regards,
    Katia
    Telerik by Progress
    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
  3. DevCraft banner
  4. Aya
    Aya avatar
    4 posts
    Member since:
    Aug 2016

    Posted 21 Aug in reply to Katia Link to this post

    First thank u Katia

    but I still have a problem ,I will clarify more  
    I have a parameter with SQL datasource and want its initial (default) value come from another parameter, the second one  its value come from code  (passed from C# code)

    any suggestion for solution??

  5. Aya
    Aya avatar
    4 posts
    Member since:
    Aug 2016

    Posted 23 Aug in reply to Katia Link to this post

    Any answer ?? 
  6. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 24 Aug in reply to Aya Link to this post


    Hi Aya,


    I not sure i understand what you need.
    But i will give it a try.


    Define your param in the designer and give them default value for test.
    So now you have 2 params one is the source and the other is the result.


    In the code behind you can do this.
    public myReport()
    {
        InitializeComponent();
        this.ReportParameters["Result"].Value = this.ReportParameters["Source"].Value;
    }
    public myReport(string myRealParam)
    {
        InitializeComponent();
        this.ReportParameters["Source"].Value = myRealParam;
        this.ReportParameters["Result"].Value = this.ReportParameters["Source"].Value;
    }



    Or you can use the Designer To say report parameter > result > value > = = Parameters.Source.Value


    Its really hard to provide the correct solution with little information.
    If this doesn't help ( i hope it will ), i will have so many question.


    regards,
    Pierre
  7. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 24 Aug in reply to Aya Link to this post

    Aya,

    I have try what you describe in your 1rst post and i can't reproduce your issue in editor preview mode.
    I created 2 parameter string
    The 1rst one has as default value " test" , the other has "=Parameters.P1.Value"
    And everything works fine.  they both diplay test.

    Do you have this issue when you call your report in your application ?

    Perhaps use a specific constructor like in my previous post.

    But why do you need 2 parameters with the same value? .. this really bug me.



Back to Top
DevCraft banner