private void Form1_Load(object sender, System.EventArgs e)
{
fpSpread1.ActiveSheet.ColumnCount = 2;
fpSpread1.ActiveSheet.Columns[0].Label = " ";
fpSpread1.ActiveSheet.Columns[1].Label = "値";
fpSpread1.ActiveSheet.HorizontalGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None);
fpSpread1.ActiveSheet.Columns[0].CellType = new FarPoint.Win.Spread.CellType.TextCellType();
fpSpread1.ActiveSheet.SetText(3, 0, "小計1");
fpSpread1.ActiveSheet.SetText(7, 0, "小計2");
fpSpread1.ActiveSheet.SetText(8, 0, "合計");
fpSpread1.ActiveSheet.Rows[3].BackColor = Color.LemonChiffon;
fpSpread1.ActiveSheet.Rows[7].BackColor = Color.LemonChiffon;
fpSpread1.ActiveSheet.Rows[8].BackColor = Color.LightPink;
fpSpread1.ActiveSheet.Columns[1].CellType = new FarPoint.Win.Spread.CellType.NumberCellType();
fpSpread1.ActiveSheet.SetValue(0, 1, 100);
fpSpread1.ActiveSheet.SetValue(1, 1, 200);
fpSpread1.ActiveSheet.SetValue(2, 1, 300);
fpSpread1.ActiveSheet.SetValue(4, 1, 400);
fpSpread1.ActiveSheet.SetValue(5, 1, 500);
fpSpread1.ActiveSheet.SetValue(6, 1, 600);
//SUBTOTAL関数を利用して小計および合計を設定します
fpSpread1.ActiveSheet.SetFormula(3, 1, "SUBTOTAL(9,B1:B3)");
fpSpread1.ActiveSheet.SetFormula(7, 1, "SUBTOTAL(9,B5:B7)");
fpSpread1.ActiveSheet.SetFormula(8, 1, "SUBTOTAL(9,B1:B7)");
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
FpSpread1.ActiveSheet.ColumnCount = 2
FpSpread1.ActiveSheet.Columns(0).Label = " "
FpSpread1.ActiveSheet.Columns(1).Label = "値"
FpSpread1.ActiveSheet.HorizontalGridLine = New FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None)
FpSpread1.ActiveSheet.Columns(0).CellType = New FarPoint.Win.Spread.CellType.TextCellType
FpSpread1.ActiveSheet.SetText(3, 0, "小計1")
FpSpread1.ActiveSheet.SetText(7, 0, "小計2")
FpSpread1.ActiveSheet.SetText(8, 0, "合計")
FpSpread1.ActiveSheet.Rows(3).BackColor = Color.LemonChiffon
FpSpread1.ActiveSheet.Rows(7).BackColor = Color.LemonChiffon
FpSpread1.ActiveSheet.Rows(8).BackColor = Color.LightPink
FpSpread1.ActiveSheet.Columns(1).CellType = New FarPoint.Win.Spread.CellType.NumberCellType
FpSpread1.ActiveSheet.SetValue(0, 1, 100)
FpSpread1.ActiveSheet.SetValue(1, 1, 200)
FpSpread1.ActiveSheet.SetValue(2, 1, 300)
FpSpread1.ActiveSheet.SetValue(4, 1, 400)
FpSpread1.ActiveSheet.SetValue(5, 1, 500)
FpSpread1.ActiveSheet.SetValue(6, 1, 600)
'SUBTOTAL関数を利用して小計および合計を設定します
FpSpread1.ActiveSheet.SetFormula(3, 1, "SUBTOTAL(9,B1:B3)")
FpSpread1.ActiveSheet.SetFormula(7, 1, "SUBTOTAL(9,B5:B7)")
FpSpread1.ActiveSheet.SetFormula(8, 1, "SUBTOTAL(9,B1:B7)")
End Sub