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

Referencing a Report control value

2 Answers 155 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chuck Harrington
Top achievements
Rank 1
Chuck Harrington asked on 10 Sep 2010, 10:57 PM
I am trying to reference a report textbox contained in a Group Footer Section.  The Value of this control is a Sum expression like this
= Sum(Fields.ABC).  I am trying to reference the calculated value of this control (named txtSumV48)  like this
If txtSumv48.Value > 0 Then
    do something spectacular
end if
I am using the Group Footer Section's ItemDataBound event to place this code.
I have tried a number of different approaches to get the calculated value but no luck.  It keeps coming up with the value "= Sum.... " and it lets me know this cannot be converted to a double or single or whatever data type conversion function I tried.  I am thinking that the report processing cycle is biting me.  First headers, then detail, then footers.  Any ideas on how to accomplish this, plus illumination/education on this will be most appreciated.  Thanks in advance

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 15 Sep 2010, 12:49 PM
Hi Chuck Harrington,

What seems to be wrong is that you had used the Definition report item instead of the Processing counterpart. The sender of the report events is always the processing counterpart of the item. You have to use the events as shown in the following code snippet:

Private Sub GroupFooterSection1_ItemDataBound(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupFooterSection1.ItemDataBound
    Dim processingGroupFooterSection = DirectCast(sender, Telerik.Reporting.Processing.GroupSection)
    Dim processingTextBox = DirectCast(processingGroupFooterSection.ChildElements.Find("TextBox9", True)(0), Telerik.Reporting.Processing.TextBox)
    If processingTextBox.Value > 0 Then
        processingTextBox.Value = "test"
    End If
End Sub

Additionally you may find useful the following help articles:
Regards,
Peter
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Chuck Harrington
Top achievements
Rank 1
answered on 16 Sep 2010, 03:31 PM
Worked well.  Only part I missed was the direct cast to the text boxes.  Once I did that, everything processed as expected.  Now I get it.  Definition vs Processing.  Thanks Peter.
Tags
General Discussions
Asked by
Chuck Harrington
Top achievements
Rank 1
Answers by
Peter
Telerik team
Chuck Harrington
Top achievements
Rank 1
Share this question
or