Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


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

C++

m_Spread.SetUserResize(UserResizeNone);
// Set the maximum number of columns
m_Spread.SetMaxCols(3);
// Provide text for the column headers
// Specify clipping block
m_Spread.SetCol(1);
m_Spread.SetCol2(3);
m_Spread.SetRow(0);
m_Spread.SetRow2(0);
// Clip data into the sheet
m_Spread.SetClip("Assets\tLiabilities\tNet Worth");
// Set the maximum number of rows
m_Spread.SetMaxRows(12);
// Provide text for the row headers
// Specify clipping block
m_Spread.SetCol(0);
m_Spread.SetCol2(0);
m_Spread.SetRow(1);
m_Spread.SetRow2(12);
// Clip data into the sheet
m_Spread.SetClip("January\r\nFebruary\r\nMarch\r\nApril\r\nMay\r\nJune\r\nJuly\r\nAugust\r\nSeptember\r\nOctober\r\nNovember\r\nDecember");
// Align the text to the left in the row headers
m_Spread.SetCol(0);
m_Spread.SetRow(-1);
m_Spread.SetTypeHAlign(TypeHAlignLeft);
// Set the column width of all columns
m_Spread.SetCol(-1);
m_Spread.SetColWidth(-1,10);
// Set the column width of the row header
m_Spread.SetColWidth(0,10);

Visual Basic

' Prevent user resizing columns and rows
fpSpread1.UserResize = UserResizeNone
' Set the maximum number of columns
fpSpread1.MaxCols = 3
' Provide text for the column headers
' Specify clipping block
fpSpread1.Col = 1
fpSpread1.Col2 = 3
fpSpread1.Row = 0
fpSpread1.Row2 = 0
' Clip data into the sheet
fpSpread1.Clip = "Assets" + Chr$(9) + "Liabilities" + Chr$(9) + "Net Worth"
' Set the maximum number of rows
fpSpread1.MaxRows = 12
' Provide text for the row headers
' Specify clipping block
fpSpread1.Col = 0
fpSpread1.Col2 = 0
fpSpread1.Row = 1
fpSpread1.Row2 = 12
' Clip data into the sheet
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"
' Align the text to the left in the row headers
fpSpread1.Col = 0
fpSpread1.Row = -1
fpSpread1.TypeHAlign = TypeHAlignLeft
' Set the column width of all columns
fpSpread1.Col = -1
fpSpread1.ColWidth(-1) = 10
' Set the column width of the row header
fpSpread1.ColWidth(0) = 10

Copyright © GrapeCity, inc. All rights reserved.