Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example hides the row headers, prevents the user from resizing the nonscrollable column, provides custom text for the column headers, and specifies a maximum number of rows and columns.

C++

// Hide the row headers
m_Spread.SetRowHeadersShow(FALSE);

// Set the number of nonscrolling columns
m_Spread.SetColsFrozen(1);

// Prevent the user from resizing the specified column
m_Spread.SetCol(1);
m_Spread.SetUserResizeCol(UserResizeOff);

// Provide text for the column headers
// Specify clipping block
m_Spread.SetCol(1);
m_Spread.SetCol2(4);
m_Spread.SetRow(0);
m_Spread.SetRow2(0);
// Clip data into the sheet
m_Spread.SetClip("Territory\tTotal Leads\tTotal Quotes\tTotal Sales");

// Set the maximum number of columns
m_Spread.SetMaxCols(4);
// Set the maximum number of rows
m_Spread.SetMaxRows(5);
// Set the column width for all columns
m_Spread.SetColWidth(-1,10);

// Provide text for the rows in the first column
// Specify clipping block
m_Spread.SetCol(1);
m_Spread.SetCol2(1);
m_Spread.SetRow(1);
m_Spread.SetRow2(5);
// Clip data into the sheet
m_Spread.SetClip("Northeast\nSoutheast\nMidwest\nNorthwest\nSouthwest");

// Align the text to the right in the first column
m_Spread.SetCol(1);
m_Spread.SetRow(-1);
m_Spread.SetTypeHAlign(TypeHAlignRight);

Visual Basic

' Hide the row headers
fpSpread1.RowHeadersShow = False

' Set the number of nonscrolling columns
fpSpread1.ColsFrozen = 1
' Prevent the user from resizing the specified column
fpSpread1.Col = 1
fpSpread1.UserResizeCol = UserResizeOff

' Provide text for the column headers
' Specify clipping block
fpSpread1.Col = 1
fpSpread1.Col2 = 4
fpSpread1.Row = 0
fpSpread1.Row2 = 0
' Clip data into the sheet
fpSpread1.Clip = "Territory" + Chr$(9) + "Total Leads" + Chr$(9) + "Total Quotes" + Chr$(9) + "Total Sales"

' Set the maximum number of columns
fpSpread1.MaxCols = 4
' Set the maximum number of rows
fpSpread1.MaxRows = 5
' Set the column width for all columns
fpSpread1.ColWidth(-1) = 10

' Provide text for the rows in the first column
' Specify clipping block
fpSpread1.Col = 1
fpSpread1.Col2 = 1
fpSpread1.Row = 1
fpSpread1.Row2 = 5
' Clip data into the sheet
fpSpread1.Clip = "Northeast" + Chr$(13) + "Southeast" + Chr$(13) + "Midwest" + Chr$(13) + "Northwest" + Chr$(13) + "Southwest"

' Align the text to the right in the first column
fpSpread1.Col = 1
fpSpread1.Row = -1
fpSpread1.TypeHAlign = TypeHAlignRight

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