Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example creates a sheet with multiple column header rows and row header columns. The auto text for the headers appears in the top row and left column, as shown in the following figure.

C++

void CmyWnd::MyFunc()
{
    long SPREADHEADER = -1000;
    // Set the maximum number of columns and rows
    m_Spread1.SetMaxCols(4);
    m_Spread1.SetMaxRows(12);
    // Create two rows of column and row headers
    // Display auto text in left and top column and row
    m_Spread1.SetColHeaderRows(2);
    m_Spread1.SetColHeadersAutoTextIndex(0);
    m_Spread1.SetRowHeaderCols(2);
    m_Spread1.SetRowHeadersAutoTextIndex(0);
    // Set up special column header
    m_Spread1.SetRow(SPREADHEADER + 1);
    m_Spread1.SetCol(1);
    m_Spread1.SetRow2(SPREADHEADER + 1);
    m_Spread1.SetCol2(4);
    m_Spread1.SetClip("North\tSouth\tEast\tWest");
    // Set up special row header
    m_Spread1.SetColWidth(SPREADHEADER + 1, 10);
    m_Spread1.SetCol(SPREADHEADER + 1);
    m_Spread1.SetRow(1);
    m_Spread1.SetCol(SPREADHEADER + 1);
    m_Spread1.SetRow2(12);
    m_Spread1.SetClip("January\rFebruary\rMarch\rApril\rMay\rJune\rJuly\rAugust\rSeptember\rOctober\rNovember\rDecember");

}

Visual Basic

Private Sub Form_Load()
    ' Set the maximum number of columns and rows
    fpSpread1.MaxCols = 4
    fpSpread1.MaxRows = 12
    ' Create two rows of column and row headers
    ' Display auto text in left and top column and row
    fpSpread1.ColHeaderRows = 2
    fpSpread1.ColHeadersAutoTextIndex = 0
    fpSpread1.RowHeaderCols = 2
    fpSpread1.RowHeadersAutoTextIndex = 0
    ' Set up special column header
    fpSpread1.Row = SpreadHeader + 1
    fpSpread1.Col = 1
    fpSpread1.Row2 = SpreadHeader + 1
    fpSpread1.Col2 = 4
    fpSpread1.Clip = "North" + Chr(9) + "South" + Chr(9) + "East" + Chr(9) + "West"
    ' Set up special row header
    fpSpread1.ColWidth(SpreadHeader + 1) = 10
    fpSpread1.Col = SpreadHeader + 1
    fpSpread1.Row = 1
    fpSpread1.Col = SpreadHeader + 1
    fpSpread1.Row2 = 12
    fpSpread1.Clip = "January" + Chr(13) + "February" + Chr(13) + "March" + Chr(13) + "April" + Chr(13) + "May" + Chr(13) + "June" + Chr(13) + "July" + Chr(13) + "August" + Chr(13) + "September" + Chr(13) + "October" + Chr(13) + "November" + Chr(13) + "December"
End Sub

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.