Unable to create a "summary of totals"
Posted: Thu Feb 14, 2013 5:02 pm
Hi. I really hope someone can help me out with this.
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:
Created multiple methods that are hard coded to columns and expected results. Only one works. Others display 0s:
Created a variable, used an inline if in a Databand column like {IIF(MyDatasource.MyDatacolumn==1,MyVariable++,""}, this just counts every row even though some rows show "2".
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?
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?