The value for totalPriceTextBox and totalCostTextBox are from datasource fields.
The value for textBox1 is defined as:
The value for textBox2 is defined as:
When I view this report in the Preview tab, totalPriceTextBox, totalCostTextBox are textBox1 are successfully displayed. However I get the error as displayed below for textbox2:
Can anyone help me on this? Thank you.
8 Answers, 1 is accepted
In expressions you can't directly reference other report items. Instead our suggestion is to update your expression as shown in the following example:
=(Fields.TotalPrice - Fields.TotalCost)/ Fields.TotalCost * 100
the Telerik team
For your info, the example that I gave on my first post was the simplified version of my report. In my actual report, there are some textboxes with expressions like this:
I also have some textboxes where I need to calculate this:
If I just use this expression (
=SUM(Fields.TotalPrice - Fields.TotalCost) / SUM(Fields.TotalPrice) * 100), I will need to calculate
SUM(Fields.TotalPrice - Fields.TotalCost)and
SUM(Fields.TotalPrice)again for each textbox. Let's say I have many rows of data, won't this affect the time taken to display the report?
The reporting engine should quickly handle such expressions. Our suggestion is to make some tests to check what is the performance impact of this expression. Still if you require to access another processing report item value you can utilize the following user function:
However have in mind that the order of report item processing is dependent on the order report items are added to it's parent Items collection. Thus the user function will only work if you utilize it from report item that is added to the items collection (designer) after it's target report item.
the Telerik team
I also have a simular problem.....
I need to filter a table on a report dynamically with the value of a textbox on the same report
Could you please tell me which parameters i need to use to call
GetProcessingItemValue( Processing.ReportItem currentReportItem, string targetReportItemName)
The approach suggested by my colleague won't work in every scenario, as he has described after the provided code snippet. Since the TextBox.Value in question is probably coming from a data source, it is best to create a user function, or modify your data source to return a calculated field, which returns the same value and can be used in the table Filtering expression.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
and i want a textbox on footer which contains the value like
TextBox3=Sum(Textbox2) i have tried something like
but did not work..
Hi telerik team,
I have two text boxes in my report. First textbox have hardcoded value 5. Now i need to get the value of the first textbox and do some calculation in second textbox. In this situation what can i do? Please help me. Thanks.