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

Issue with Parameters after upgrading version

1 Answer 101 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vanessa
Top achievements
Rank 1
Vanessa asked on 27 Mar 2018, 01:46 AM

I was using Telerik 2014 Q2 SP1 and upgraded my report to 2018 R1 and one of my reports does not show a parameter I am passing down. 

 

Report A has a subreport (Report B) and Report A creates a parameter for Report B 

    instanceReportSource1.Parameters.Add(new Parameter("SampleParameter", "=Fields.SampleParameter"));

In my code for Report B I want to pull the parameter value that is being passed in order to filter some data, so I have: 

     var param = Convert.ToInt32(this.ReportParameters["SampleParameter"].Value);

This worked just fine before and instead of this.ReportParameters["SampleParameter"].Value having a value it just says the value is  "=Fields.SampleParameter". 

 

Was there a change in how parameters were retrieved or accessed in this way? 

1 Answer, 1 is accepted

Sort by
0
Accepted
Silviya
Telerik team
answered on 29 Mar 2018, 02:58 PM
Hi Vanessa,

In R3 2016 release there was a major change in how each definition item property values are read and cached (that was an optimization change). For more details please check Changes on items in report events are not applied KB article.

Based on how you access them, there are two available approaches:
1. If you change the item definitions inside events those changes will no longer be applied. The correct approach is to get the processing item - examples are provided the above mentioned article and Report Events section.
Instead, you need to access the processing report parameters as demonstrated in this example.

There is an option to revert back to the old behavior (with the cost of the optimizations in rendering that were introduced) by adding a cacheDefinitionProperties setting in the application configuration file - an example is provided in mentioned in the beginning KB article.

2. In case you are not accessing the parameter values in events.
The recommended approach of assigning data source and parameters in the report definition are shown in our Invoice example report, which contains a sub-report named SalesOrderDetails, passing the Sales order ID as a parameter.

Regards,
Silviya
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
Tags
General Discussions
Asked by
Vanessa
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Share this question
or