Is there a way to enumerate the items; i.e. textboxes, contained in a section of the report, say the LabelsGroupFooter, or a panel contained in a report section?
Thanks
I think I've stumbled upon a means to do this, probably a better way, but the following works:
"pnlTotals" is a panel control which sits in the labelsGroupFooter. It has the textboxes which contain the totals from each column of the report. The purpose of this "excercise" is to flush out column totals if there's no data in the report datasource. This is done in the report NeedDataSource event handler.
Thanks
I think I've stumbled upon a means to do this, probably a better way, but the following works:
IEnumerator itemEnumerator =
this
.pnlTotals.Items.GetEnumerator();
while
(itemEnumerator.MoveNext())
{
if
(itemEnumerator.Current.GetType() ==
typeof
(Telerik.Reporting.TextBox))
{
Telerik.Reporting.TextBox textBox = (Telerik.Reporting.TextBox)itemEnumerator.Current;
// value contains an expression, vs. literal text?
if
(textBox.Value.StartsWith(
"="
))
textBox.Value =
"0"
;
}
}
"pnlTotals" is a panel control which sits in the labelsGroupFooter. It has the textboxes which contain the totals from each column of the report. The purpose of this "excercise" is to flush out column totals if there's no data in the report datasource. This is done in the report NeedDataSource event handler.
// bind the data table to the .DataSource property of the report
(sender
as
Telerik.Reporting.Processing.Report).DataSource =
this
.dtSource;
// if the query didn't return any rows, hide the groups and the detail section
if
(
this
.dtSource.Rows.Count == 0)
{
this
.gL_ACCT_CODEGroup.Visible =
false
;
this
.dEPT_CODE_NAMEGroup.Visible =
false
;
this
.detail.Visible =
false
;
IEnumerator itemEnumerator =
this
.pnlTotals.Items.GetEnumerator();
while
(itemEnumerator.MoveNext())
{
if
(itemEnumerator.Current.GetType() ==
typeof
(Telerik.Reporting.TextBox))
{
Telerik.Reporting.TextBox textBox = (Telerik.Reporting.TextBox)itemEnumerator.Current;
// value contains an expression, vs. literal text?
if
(textBox.Value.StartsWith(
"="
))
textBox.Value =
"0"
;
}
}
}