ActiveReports 14 .NET Edition
GrapeCity.ActiveReports.Export.Excel Assembly / GrapeCity.SpreadBuilder Namespace / DDSheets Class / Count Property
Example

In This Topic
    Count Property (DDSheets)
    In This Topic
    Gets the number of elements contained in the DDSheets collection.
    Syntax
    'Declaration
     
    Public ReadOnly Property Count As Integer
    public int Count {get;}

    Property Value

    Integer.
    Remarks
    This property is read-only.
    Example
    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();
    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()
    See Also