ActiveReports 8
Count Property
See Also  Example
GrapeCity.ActiveReports.Export.Excel.v8 Assembly > GrapeCity.SpreadBuilder Namespace > DDSheets Class : Count Property

Glossary Item Box

Gets the number of elements contained in the DDSheets collection.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Count As System.Integer
C# 
public System.int Count {get;}

Property Value

Integer.

Remarks

This property is read-only.

Example

C#Copy Code
if (MessageBox.Show ("Your spreadsheet is " + sb.Sheets.Count.ToString() + " sheet(s) long. Okay to save?", "Save", MessageBoxButtons.YesNo) == DialogResult.Yes) 
{
    //Save the Workbook to an Excel file
    sb.Save (Application.StartupPath + @"\x.xls");
    MessageBox.Show("Your Spreadsheet, " + sb.Sheets[0].Columns(0).OwnerSheet.Name + ", has been saved to " + Application.StartupPath + "\\x.xls");
}
sb.Clear();
Visual BasicCopy Code
If MessageBox.Show("Your spreadsheet is " + sb.Sheets.Count.ToString() + " sheet(s) long. Okay to save?", "Save", MessageBoxButtons.YesNo) = DialogResult.Yes Then
	'Save the Workbook to an Excel file
	sb.Save(Application.StartupPath + "\x.xls")
	MessageBox.Show("Your Spreadsheet, " + sb.Sheets(0).Columns(0).OwnerSheet.Name + ", has been saved to " + Application.StartupPath + "\x.xls")
End If
sb.Clear()

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also