How to find the text property of a textbox

Stimulsoft Reports.NET discussion
Post Reply
gaurav2325
Posts: 1
Joined: Mon Feb 23, 2015 9:36 am

How to find the text property of a textbox

Post by gaurav2325 »

Hi,

I have to load all the components and there value.

For eg, below is the Xml file for the report. Now I want to read NAME and TEXT.

<Components isList="true" count="6">
<Text1 Ref="14" type="Text" isKey="true">
<Name>Text1</Name>
<Page isRef="10" />
<Parent isRef="13" />
<Text>Test Name for text</Text>
<TextBrush>Black</TextBrush>
<Type>Expression</Type>
</Text1>

I am using the following code,

StiReport Report = new StiReport();
Report .Load(Path.GetFullPath(fileName));

m_GlobalFileName = name;

StiComponentsCollection collection = Report .GetComponents();

foreach (StiComponent TextComp in collection)
{
if (TextComp is StiText)
{
messagebox.show(name + "." + TextComp.Name, TextComp.Tag);
}
}

Using the TextComp.Name, I am able to get the name of the text but not able to find the property TEXT. That should return "Test Name for text"

Please let me know, how it can be done.

Thanks
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to find the text property of a textbox

Post by HighAley »

Hello.

The StiComponent class has no Text property. You should convert it to StiText.

Code: Select all

(TextComp as StiText).Text
Thank you.
Post Reply