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

Parent List and child list in one table

3 Answers 204 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sebastian
Top achievements
Rank 1
Sebastian asked on 23 Sep 2013, 05:15 PM
Hello, 

I have the next situation:

1. I have an object called denominations with two string attributes.
2. I have an object called medias with two string attributes
3. I have an object called Cash with two string atributes and a list of denominations attribute
4. I have an object called Envelopes with two string atributes and a list of medias attribute
3. I have an object called Deposits with several string attributes and a list of cash and a list of envelopes in the attributes.

Something like this:

 
public class DepositWidgetDto
    {
       public DepositWidgetDto()
        {
            Accounts = new List<string>();
        }
 
        public Guid Id { get; set; }
 
        public string Number { get; set; }
 
        public List<string> SealsCodes { get; set; }
 
        public int NonRecognized { get; set; }
 
        public List<CashDto> Cash { get; set; }
 
        public List<EnvelopeDto> Envelopes { get; set; }
 
        public List<UnVerifiedDto> UnVerified { get; set; }
 
        public List<string> Accounts { get; set; }
    }

I need to show in one table all the information, no matter if I have to repeat each parent value per each child value; example:

number |  SealCode | CashList Attribute1 | CashList Attribute2 List1 | EnvelopList Att1 | EnvelopList Att2 List
0001 0001 value1 valueList1 value1 valueList1
0001 0002 value1 valueList2 value1 valueList2
0001 0002 value1 valueList3 value1 no value
0002 00012 value2 valueList12 no value no value
0002 00012 value2 valueList13 no value no value
0003 00013 no value no value value12 valueList12
0003 00013 no value no value value12 valueList13
.
.
.


How Could I do that in telerik reporting in one table?

Thanks

3 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 26 Sep 2013, 04:20 PM
Hello Sebastian,

In order to display the data from the Deposits object in a single tabular structure, you need to flatten it. The you can wrap it in an ObjectDataSource component and use it to create a report layout with TextBox items or Table item.

If you are interested in creating other layout to display the data from the nested collections, you can use nested table items and bindings as described in the following forum thread: Data Source Business Objects

Let us know if you need any further help.

Regards,
Stef
Telerik

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

0
Sebastian
Top achievements
Rank 1
answered on 27 Sep 2013, 04:19 PM
Hello Stef,

Thanks for your answer but I am a Little confused with your explanation.
Could you give me some example to understand better the solution. I am new in telerik reporting

Thanks,
0
IvanY
Telerik team
answered on 02 Oct 2013, 02:18 PM
Hello Sebastian,

As explained in the previous post you will have to flatten your data in order to use our ObjectDataSource component. In this thread you can find some effective solutions that show you how to flatten your data. Simply pick one that suits you best and use it.

Once you have the object with the flat data simply follow these steps to setup and use the ObjectDataSource component with the new object that you have created above: ObjectDataSource Wizard.

Regards,
IvanY
Telerik

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

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