I want to have a summary at the end of my report. I have already added the Summary Band. I have a databand outputting rows from a datasource further up in the report nested in a few GroupBands.
I have tried:
Creating a method in the code that will take in two arguments, column name and expected result. It works once and then displays 0's for the rest:
Code: Select all
private string GetCount(string column, string ExpectedValue)
{
int count = 0;
foreach (object row in MyDataSource.Rows)
{
Stimulsoft.Report.Dictionary.StiRow rowHold = (Stimulsoft.Report.Dictionary.StiRow) row;
if (rowHold[column].ToString() == ExpectedValue)
count++;
}
return count.ToString();
}
Code: Select all
private string GetCount()
{
int count = 0;
foreach (object row in MyDataSource.Rows)
{
Stimulsoft.Report.Dictionary.StiRow rowHold = (Stimulsoft.Report.Dictionary.StiRow) row;
if (rowHold["MyColumn"].ToString() == 1)
count++;
}
return count.ToString();
}
private string GetCount()
{
int count = 0;
foreach (object row in MyDataSource.Rows)
{
Stimulsoft.Report.Dictionary.StiRow rowHold = (Stimulsoft.Report.Dictionary.StiRow) row;
if (rowHold["MyColumn"].ToString() == 2)
count++;
}
return count.ToString();
}
Changed the SummaryBand to Render at end of report.
I just want to display about 10 items in this SummaryBand, counting things like "MyDatasource.MyDatacolumn==1", "MyDatasource.MyDatacolumn==2", "MyDatasource.MyOtherDatacolumn==true" etc.
Can this even be done?