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

Stimulsoft Reports.NET discussion
Post Reply
theregister
Posts: 53
Joined: Wed Nov 27, 2013 5:24 pm

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

Post 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".
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post by HighAley »

Hello.

Try to get next property:

Code: Select all

 MsgBox(comp.Text)
Thank you.
theregister
Posts: 53
Joined: Wed Nov 27, 2013 5:24 pm

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

Post by theregister »

It says 'text' is not a member of 'Stimulsoft.Report.Components.StiComponent' though.
theregister
Posts: 53
Joined: Wed Nov 27, 2013 5:24 pm

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

Post by theregister »

Well I made it work how I wanted by doing this:

Code: Select all

TryCast(Report.GetComponentByName(comp.Name), StiText).Text
Thanks.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

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

Post by Andrew »

Hello,

Thank you for sharing your solution!
Post Reply