Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example creates a one-column sheet that contains percent values. The minimum value allowed is 1%. The decimal symbol is a carat ("^") and only one decimal place is displayed.

C++

m_Spread1.MaxCols(1);
m_Spread1.ColWidth(SPREADHEADER,13);
m_Spread1.RowHeight(SPREADHEADER,20);
m_Spread1.Col(1);
m_Spread1.Row(SPREADHEADER);
m_Spread1.Text("Market Share");
m_Spread1.Col(SPREADHEADER);
m_Spread1.Row(1);
m_Spread1.Text("Six's Company");
m_Spread1.Row(2);
m_Spread1.Text("Trauma Center");
m_Spread1.Row(3);
m_Spread1.Text("Z Files");
m_Spread1.Row(4);
m_Spread1.Text("DTJ");
m_Spread1.Row(5);
m_Spread1.Text("Anarchy & Chaos");
m_Spread1.Row(6);
m_Spread1.Text("This New Abode");
// define percent cell settings
m_Spread1.Col(1);
m_Spread1.Row(-1);
m_Spread1.CellType(CellTypePercent);
m_Spread1.TypePercentDecimal("^");
m_Spread1.TypePercentMin(1);
m_Spread1.TypePercentDecPlaces(1);

Visual Basic

fpSpread1.MaxCols = 1
fpSpread1.ColWidth(SpreadHeader) = 13
fpSpread1.RowHeight(SpreadHeader) = 20
fpSpread1.Col = 1
fpSpread1.Row = SpreadHeader
fpSpread1.Text = "Market Share"
fpSpread1.Col = SpreadHeader
fpSpread1.Row = 1
fpSpread1.Text = "Six's Company"
fpSpread1.Row = 2
fpSpread1.Text = "Trauma Center"
fpSpread1.Row = 3
fpSpread1.Text = "Z Files"
fpSpread1.Row = 4
fpSpread1.Text = "DTJ"
fpSpread1.Row = 5
fpSpread1.Text = "Anarchy & Chaos"
fpSpread1.Row = 6
fpSpread1.Text = "This New Abode"
' define percent cell settings
fpSpread1.Col = 1
fpSpread1.Row = -1
fpSpread1.CellType = CellTypePercent
fpSpread1.TypePercentDecimal = "^"
fpSpread1.TypePercentMin = 1
fpSpread1.TypePercentDecPlaces = 1

Copyright © GrapeCity, inc. All rights reserved.