How to Use UserIdentity.Context to Pass Custom Objects to the Report
Environment
| Product | Progress® Telerik® Reporting |
Description
In some scenarios, it may be necessary to pass custom object values directly to the Report, without using Global Objects as Report Parameters.
Solution
The UserIdentity object has a property Context that by default is Null.
It is of type System.Collections.Concurrent.ConcurrentDictionary<string, object>. You may read more about how to pass a value to
this property in the
How to use information from HttpContext in Custom Report Resolver
KB article. Then in the report, you may access the values of the collection.
For example, the first value of the collection may be used in an Expression like:
= Item(0, UserIdentity.Context.Values)
Note that you won't be able to access the property UserIdentity.Context.Values directly in the Expression editor of the Report Designers. You will have to type it manually.