Get value of text component
Get value of text component
Hi,
I have assigned text component with value from datasource. When i try to get the value in before print event using Text1.text, i'm getting {DataSource1.param2} instead of the actual value. How to get the assigned value?
I have assigned text component with value from datasource. When i try to get the value in before print event using Text1.text, i'm getting {DataSource1.param2} instead of the actual value. How to get the assigned value?
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Get value of text component
Hello,
In the PHP version, code events are not supported.
Thank you.
In the PHP version, code events are not supported.
Thank you.
Re: Get value of text component
Hi,
Thanks for your response.
I'm changing the height of the text component using Text1.height, but this has to be done only based on the value from datasource.
I thought i can get the value from text component and use the same to check whether the condition is satisfied or not but as per your response that is not possible, so is there any other way to achieve the same?
Thanks for your response.
I'm changing the height of the text component using Text1.height, but this has to be done only based on the value from datasource.
I thought i can get the value from text component and use the same to check whether the condition is satisfied or not but as per your response that is not possible, so is there any other way to achieve the same?
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Get value of text component
Hello,
Unfortunately, no.
Thank you.
Unfortunately, no.
Thank you.
Re: Get value of text component
I realize this is a bit of an older post, but could you not use the following expression to get the actual value of the text component?
{Text1.Text.Value} == "some string"
Text1.Text.Value I believe is always stored as a string so if you need to compare the value to an integer, the following expression should work.
int.Parse(Text1.Text.Value) == 2
{Text1.Text.Value} == "some string"
Text1.Text.Value I believe is always stored as a string so if you need to compare the value to an integer, the following expression should work.
int.Parse(Text1.Text.Value) == 2
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Get value of text component
Hello,
During the report, rendering exists two instances of each component (minimum two instances). One instance - component in the report template. Second instance - component which created the rendered report. During the creation of the second instance, report engine calculates expressions and write it to the second instance. When you write code like this:
Text23.Text = "test";
you call instances from report template which does not contain calculated values from expressions.
You can:
1. Instead of "{Text1.TextValue}" expression using the same expression as in Text1.Text property, or
2. Use variables. In this case, you can calculate value in variable, and then use this variable in expressions.
Thank you.
During the report, rendering exists two instances of each component (minimum two instances). One instance - component in the report template. Second instance - component which created the rendered report. During the creation of the second instance, report engine calculates expressions and write it to the second instance. When you write code like this:
Text23.Text = "test";
you call instances from report template which does not contain calculated values from expressions.
You can:
1. Instead of "{Text1.TextValue}" expression using the same expression as in Text1.Text property, or
2. Use variables. In this case, you can calculate value in variable, and then use this variable in expressions.
Thank you.
Re: Get value of text component
Thanks for the explanation Lech!
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Get value of text component
Hello,
You are welcome.
You are welcome.