This is a migrated thread and some comments may be shown as answers.

Give the report parameter initial value from another passed parameter

5 Answers 390 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aya
Top achievements
Rank 1
Aya asked on 18 Aug 2016, 04:35 PM

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??

 

5 Answers, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 19 Aug 2016, 09:02 AM
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
0
Aya
Top achievements
Rank 1
answered on 21 Aug 2016, 02:19 PM

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??

0
Aya
Top achievements
Rank 1
answered on 23 Aug 2016, 02:42 PM
Any answer ?? 
0
Pierre
Top achievements
Rank 1
answered on 24 Aug 2016, 08:54 AM

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
0
Pierre
Top achievements
Rank 1
answered on 24 Aug 2016, 09:26 AM

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.



Tags
General Discussions
Asked by
Aya
Top achievements
Rank 1
Answers by
Katia
Telerik team
Aya
Top achievements
Rank 1
Pierre
Top achievements
Rank 1
Share this question
or