Unable to create a "summary of totals"

Stimulsoft Reports.NET discussion
Post Reply
jeffzizzi
Posts: 1
Joined: Tue Aug 14, 2012 6:24 pm

Unable to create a "summary of totals"

Post by jeffzizzi »

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:

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();
		}
Created multiple methods that are hard coded to columns and expected results. Only one works. Others display 0s:

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();
		}
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?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Unable to create a "summary of totals"

Post by Alex K. »

Hello,

Can you please send a sample which reproduce the issue for analysis.

Thank you.
Post Reply