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

Bindng to Object with lists and array

3 Answers 268 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bronnikov
Top achievements
Rank 1
Bronnikov asked on 27 May 2013, 01:14 PM
Hello, I have some problem with binding to object like

class ObjectDataSource {   
     public List<Product>  ProductListMain;
     public List<Product> ProductListSecond;
     public IdValue[] Parameters;
}
class Product {
    public string Name;
    public int Count;
}
class IdValue {
    public int Id;
    public int Value;
}

I can't create correct report to show me 3 different tables, where 2 first table get data from Lists and the 3-rd table get data from array.
Please show me the right path.

3 Answers, 1 is accepted

Sort by
0
Accepted
Stef
Telerik team
answered on 30 May 2013, 12:58 PM
Hello Aleksandr,

Please check the attached sample report illustrating how to use the nested collections of your object data source as data for Table items in it. Notice how the Table items DataSource properties are bound to specific collection using binding expression.

I hope this helps.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Bronnikov
Top achievements
Rank 1
answered on 30 May 2013, 01:01 PM
Thanks a lot
0
Vijayan
Top achievements
Rank 1
answered on 02 Jan 2018, 09:18 AM

I am using object data source to bind the data. But I am breaking my head to fix the list of objects in the report designer which is failing in the preview report. my business model returning List of objects from a class. like, 

Public class Master

{

     public int id {get;set;}

    public string name {get;set;}
    public string deptname {get;set;}

    public List<content>  content {get;set;}
}

 

public class content

{

public int contentID{get;set;}

public string contentName {get;set;}

}

My businesslogic method like below, 

public async Task<List<Master>> GetAppointmentToken(string AppNo)

{

----------Business return list of objects of Master----------

}

Questions, 

1. how do I define a object in the report?  ( =Fields.Master.ID) or (=Fields.ID)

2. Given model (Content) how do I bind in the report ? (=Fields.Master.Content.ID)  

Could you please give me same report for "Report Designer Q2 2015" version. The one you attached is an old version of Telerik report.

Thanks.

Tags
General Discussions
Asked by
Bronnikov
Top achievements
Rank 1
Answers by
Stef
Telerik team
Bronnikov
Top achievements
Rank 1
Vijayan
Top achievements
Rank 1
Share this question
or