StiText get value of text during databand events

Stimulsoft Reports.WEB discussion
Post Reply
bburge
Posts: 1
Joined: Tue Aug 08, 2017 12:18 pm

StiText get value of text during databand events

Post by bburge »

We are attempting to detect when a databand has no substantial data bound and, in those cases, we would like to hide the databand. To achieve this, we need to detect two properties of each StiText component that is in the databand:

1) The Expression used – i.e., “{FirstName}”
2) The bound value – i.e., “John”

On the databand’s events (we have tried various stages), we have tried calling off to a static method to which we have passed a reference to the databand. We can get access to the StiText components however, we cannot seem to get the bound value or the expression. Even if the StiText component was using static text (such as “First Name: ”) we still cannot seem to get the value. When we look at the .Text and .TextValue during debug – they are null.

How do we access the Text Value of the StiText components and how do we determine if the value was the result of databinding or the text was static? Any assistance is appreciated.

We are using DesignerFX with ASP NET MVC and have updated to the latest version.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: StiText get value of text during databand events

Post by Alex K. »

Hello,

During report rendering exists two instances of each component (minimum two instances). One instance - component in the report template. Second instance - component which created for rendered report. During creation of the second instance, report engine calculates expressions and write it to the second instance. When you write an expression like this:
{Text1.Text}
you call instances from report template which does not contain calculated values from expressions.
You can try to use the report.RenderedPages.GetComponentByName() to get the rendered value.

If possible please send us a sample report with test data which show your issue, we will try to find a solution for you.

Thank you.
Post Reply