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
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:
- How to: Cascading Parameters with applied filtering on Report level
- How to: Cascading Parameters with applied filtering on data source level
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
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??
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
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.