Accessing an item outside of a bound table in Telerik Reporting

1 Answer 19 Views
Binding DataSource JSON Expressions Report Designer (standalone) Table
Marcel
Top achievements
Rank 1
Marcel asked on 21 Mar 2024, 01:06 PM

We have a JSON dataset (attached) where one of the nodes is a list of products. We are displaying these products in a table in the detail section. This table has the corresponding ProductList Datasource and has 3 columns: "UP", "Total", "Net UP".  We obtain the "UP" and "Total" directly from the DataSource (Fields.[@UP], Fields.[@Total]). To obtain the "Net UP" we need to check all Discounts nodes in the same line that [@Type]= "Comercial" , take the [@Rate] and multiply it with the Fields.[@UP] of that line.

We are trying to do this inserting a table to which we have bound its DataSource to the Fields.Discounts.Discount field in the "Net UP" column. With this we can obtain the [@Rate] of the discount but the problem here is that we can not address the Fields.[@UP] because it is in another context.

Do you have any idea how we can achieve that?

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 26 Mar 2024, 10:04 AM

Hello Marcel,

Thank you for the attached JSON sample and the additional information!

I confirm that it is possible to access the value of a field outside the data item's scope as long as it is within the parent data scope - Expression/Data Scope Explained - Telerik Reporting.

If the table with the discounts is nested within the main table with the products, then the @UP field should be accessible through the Parent keyword, for example:

For more details on how to use parent data, you may refer to the Binding to Data Overview - Telerik Reporting article.

I have attached a sample report that I created with the sample data, I hope it will help. Please let me know if you have any additional questions.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Marcel
Top achievements
Rank 1
commented on 26 Mar 2024, 11:49 AM

Thanks Dimitar! It worked perfectly for us.
Tags
Binding DataSource JSON Expressions Report Designer (standalone) Table
Asked by
Marcel
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or