Page 1 of 1

How to get content out of textbox when it isn't text?

Posted: Tue Feb 18, 2014 11:57 pm
by theregister
When we insert a Text box into the report, and it looks like this:

Image

we can select its text right? This worked for me.

Code: Select all

For Each comp As StiComponent In Report.GetComponents
  MsgBox(comp.Name)
Next
But what about when the Text box doesn't quite have just text but rather something like this:

Image

How can we get not the value of that but rather just the text, what is inside the { }, "myTable.myField" in that case. All it returns to me is "Text1".

Re: How to get content out of textbox when it isn't text?

Posted: Wed Feb 19, 2014 11:18 am
by HighAley
Hello.

Try to get next property:

Code: Select all

 MsgBox(comp.Text)
Thank you.

Re: How to get content out of textbox when it isn't text?

Posted: Wed Feb 19, 2014 3:57 pm
by theregister
It says 'text' is not a member of 'Stimulsoft.Report.Components.StiComponent' though.

Re: How to get content out of textbox when it isn't text?

Posted: Wed Feb 19, 2014 7:48 pm
by theregister
Well I made it work how I wanted by doing this:

Code: Select all

TryCast(Report.GetComponentByName(comp.Name), StiText).Text
Thanks.

Re: How to get content out of textbox when it isn't text?

Posted: Thu Feb 20, 2014 2:49 am
by Andrew
Hello,

Thank you for sharing your solution!