Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example hides the column headers, provides custom text for the row headers, right aligns the text in the row headers, and specifies the maximum number of columns. The following figure illustrates the sheet before (top figure) and after (bottom figure) the last row is hidden.

C++

// Set the maximum number of rows
m_Spread.SetMaxRows(7);

// Provide text for row header
// Specify clipping block
m_Spread.SetCol(0);
m_Spread.SetCol2(0);
m_Spread.SetRow(1);
m_Spread.SetRow2(7);
// Clip data into the sheet
m_Spread.SetClip("Name\nAddress\r\nHome Phone\r\n Work Phone\r\nCar Phone\r\nFax\r\nE-mail Address");

// Right align text in the row header
m_Spread.SetCol(0);
m_Spread.SetRow(-1);
m_Spread.SetTypeHAlign(TypeHAlignRight);

// Set the maximum number of columns
m_Spread.SetMaxCols(1);

// Set the column width of the row header
m_Spread.SetColWidth(0,12);
// Set the column width of a selected column
m_Spread.SetColWidth(1,25);
// Set the row height for all the rows
m_Spread.SetRowHeight(-1,13);

// Hide the column headers
m_Spread.SetColHeadersShow(FALSE);

// Hide the specified row
m_Spread.SetRow(7);
m_Spread.SetRowHidden(TRUE);

// Display the vertical scroll bar only
m_Spread.SetScrollBars(ScrollBarsVertical);

Visual Basic

' Set the maximum number of rows
fpSpread1.MaxRows = 7

' Provide text for row header
' Specify clipping block
fpSpread1.Col = 0
fpSpread1.Col2 = 0
fpSpread1.Row = 1
fpSpread1.Row2 = 7
' Clip data into the sheet
fpSpread1.Clip = "Name" + Chr$(13) + "Address" + Chr$(13) + "Home Phone" + Chr$(13) + "Work Phone" + Chr$(13) + "Car Phone" + Chr$(13) + "Fax" + Chr$(13) + "E-mail Address"

' Right align text in the row header
fpSpread1.Col = 0
fpSpread1.Row = -1
fpSpread1.TypeHAlign = TypeHAlignRight

' Set the maximum number of columns
fpSpread1.MaxCols = 1

' Set the column width of the row header
fpSpread1.ColWidth(0) = 12
' Set the column width of a selected column
fpSpread1.ColWidth(1) = 25
' Set the row height for all the rows
fpSpread1.RowHeight(-1) = 13

' Hide the column headers
fpSpread1.ColHeadersShow = False

' Hide the specified row
fpSpread1.Row = 7
fpSpread1.RowHidden = True

' Display the vertical scroll bar only
fpSpread1.ScrollBars = ScrollBarsVertical

Copyright © GrapeCity, inc. All rights reserved.