Stimulsoft 2015.3 Get Text property in Text Components in the report

Stimulsoft Reports.WPF discussion
Post Reply
diegoaferreira82
Posts: 1
Joined: Wed Sep 09, 2026 10:56 am

Stimulsoft 2015.3 Get Text property in Text Components in the report

Post by diegoaferreira82 »

I need to get the property Text of a text component of a report page in Stimulsoft with the following loop:

Reports.DeRelPessoaUsuarioFUNAJURISPagamento_eSocial rep4 = new Reports.DeRelPessoaUsuarioFUNAJURISPagamento_eSocial();

foreach (StiPage reportPage in rep4.Pages)
{
foreach (StiComponent comp in reportPage.GetComponents())
{
StiText stiText = comp as StiText;
if (stiText != null)
{
StiDataBand dataBand = stiText.Parent as StiDataBand;
if (dataBand != null)
{
string expressao = string.Empty;
try
{
var textObj = stiText.GetType().GetProperty("Text")?.GetValue(stiText, null);
if (textObj != null)
{
var valueProp = textObj.GetType().GetProperty("Value");
if (valueProp != null)
{
expressao = valueProp.GetValue(textObj, null)?.ToString();
}
}
}
catch { }
if (string.IsNullOrEmpty(expressao))
{
expressao = stiText.TextValue;
}

if (!string.IsNullOrEmpty(expressao))
{
MessageBox.Show("DataBand: " + dataBand.Name + " | Componente: " + stiText.Name + " | Expressão: " + expressao);
}
}
}
}
}

While editing the report in Stimulsoft the text property is {dataSource.Column}, like {Client.Name}, and I want to get this information (the dataSource and the column name), but the loop above always returns the variable expressao as NULL.

I made a loop to get all the properties and their values and I didn't find any with the information I want. Anybody please help.
Lech Kulikowski
Posts: 7851
Joined: Tue Mar 20, 2018 5:34 am

Re: Stimulsoft 2015.3 Get Text property in Text Components in the report

Post by Lech Kulikowski »

Hello,

Please send us a sample project that reproduces the issue for analysis.

Thank you.
Attachments
Screenshot 2026-09-09 213200.png
Screenshot 2026-09-09 213200.png (216.98 KiB) Viewed 10 times
Post Reply