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

Dictionary object for objectdatasource

4 Answers 334 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
kid
Top achievements
Rank 1
kid asked on 18 May 2016, 06:17 AM

I am a new for Telerik, I create a objectdatasource List<Dictionary<string, object>>

 

my mock data :
data['key1'] = 'value1'

I used below expression to display the value, but not support

= ReportItem.DataObject.key1 ? not support... 

how can I display the key value in tempalte?

 

 

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 19 May 2016, 02:42 PM
Hello kid,

Please check the attached video that illustrates how to bind to collection properties based on How to Databind to Collection Properties and How to use the ReportItem.DataObject property in expressions.

Keys and Values can be accessed via Fields.Keys and Fields,Values in expressions.

The video is a SWF file that can be previewed in IE browser.

Regards,
Stef
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
0
kid
Top achievements
Rank 1
answered on 23 May 2016, 09:56 AM

Cool~~~

 

but my report only display a form.

e.g.

First Name: Fields['firstName']        Last Name : Fields['lastName']

Mobile      : Fields['mobile']              Email          : Fields['email']

Address :  Fields['address']

 

 

How can do it?

 

  

 

0
kid
Top achievements
Rank 1
answered on 23 May 2016, 09:58 AM
Fields is an object of Dictionary<string, object>
0
Accepted
Stef
Telerik team
answered on 25 May 2016, 05:21 PM
Hello,

The fields names will be the name of the direct properties of the wrapped business object. If it is a List of Dictionary, there will be fields like Keys and Values.

In your case, you can test using custom functions to get the desired values from the data object. In case of designing reports with the Standalone Report Designer, the designer will have to load the custom assembly with the user functions - Extending Report Designer (tutorials are available at the bottom of the article).


You can pass the current container's data object to the user function by using ReportItem.DataObject in expressions.


I hope this information is helpful.

Regards,
Stef
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
Report Designer (standalone)
Asked by
kid
Top achievements
Rank 1
Answers by
Stef
Telerik team
kid
Top achievements
Rank 1
Share this question
or