Stimulsoft 2015.3 Get Text property in Text Components in the report
Posted: Wed Sep 09, 2026 11:04 am
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.
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.