private void Form1_Load(object sender, System.EventArgs e)
{
fpSpread1.ActiveSheet.ColumnCount = 5;
fpSpread1.ActiveSheet.RowCount = 6;
fpSpread1.ActiveSheet.DefaultStyle.CellType = new FarPoint.Win.Spread.CellType.NumberCellType();
for (int i = 0; i <= fpSpread1.ActiveSheet.RowCount -1 ; i++)
{
for (int j = 0; j <= fpSpread1.ActiveSheet.ColumnCount -1 ; j++)
{
fpSpread1.ActiveSheet.SetValue(i, j, i + j);
}
}
}
private void button1_Click(object sender, System.EventArgs e)
{
FarPoint.Win.Spread.PrintInfo pi = new FarPoint.Win.Spread.PrintInfo();
//印刷プレビュー画面を表示します
pi.Preview = true;
//ヘッダに「カラー」「イメージ」を設定します
pi.Colors = new Color[] {Color.Red, Color.Blue};
pi.Images = new Image[] {Image.FromFile("画像ファイルパス名1")};
pi.Header = "/fn\"Arial\"/fz\"10\"/cl\"0\"/fb0/fu0/fi0/dl /ds /tl /p///pc Page /n /fn\"Times New Roman\"/fz\"14\"/cl\"1\"/fb1/fu0/fi1/g\"0\" SPREAD for .NET";
//色を印刷します
pi.ShowColor= true;
//行ヘッダを印刷しません
pi.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide;
//「上」「左」マージンを設定します
pi.Margin.Top = 20;
pi.Margin.Left = 30;
//「ColStart・ColEnd」「RowStart・RowEnd」の 各プロパティによって表される領域を印刷します
pi.PrintType = FarPoint.Win.Spread.PrintType.CellRange;
//列1〜3を印刷します
pi.ColStart = 0;
pi.ColEnd = 2;
//行2〜4を印刷します
pi.RowStart = 1;
pi.RowEnd = 3;
//定義したPrintInfoオブジェクトを設定します
fpSpread1.ActiveSheet.PrintInfo = pi;
//アクティブシート印刷します
fpSpread1.PrintSheet(fpSpread1.ActiveSheet);
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
FpSpread1.ActiveSheet.ColumnCount = 5
FpSpread1.ActiveSheet.RowCount = 6
FpSpread1.ActiveSheet.DefaultStyle.CellType = New FarPoint.Win.Spread.CellType.NumberCellType
For i As Integer = 0 To FpSpread1.ActiveSheet.RowCount - 1
For j As Integer = 0 To FpSpread1.ActiveSheet.ColumnCount - 1
FpSpread1.ActiveSheet.SetValue(i, j, i + j)
Next
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pi As New FarPoint.Win.Spread.PrintInfo
'印刷プレビュー画面を表示します
pi.Preview = True
'ヘッダに「カラー」「イメージ」を設定します
pi.Colors = New Color() {Color.Red, Color.Blue}
pi.Images = New Image() {Image.FromFile("画像ファイルパス名1")}
pi.Header = "/fn""Arial""/fz""10""/cl""0""/fb0/fu0/fi0" + _
"/dl /ds /tl /p///pc Page /n " + _
"/fn""Times New Roman""/fz""14""/cl""1""/fb1/fu0/fi1" + _
"/g""0"" SPREAD for .NET"
'色を印刷します
pi.ShowColor= True
'行ヘッダを印刷しません
pi.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide
'「上」「左」マージンを設定します
pi.Margin.Top = 20
pi.Margin.Left = 30
'「ColStart・ColEnd」「RowStart・RowEnd」の 各プロパティによって表される領域を印刷します
pi.PrintType = FarPoint.Win.Spread.PrintType.CellRange
'列1〜3を印刷します
pi.ColStart = 0
pi.ColEnd = 2
'行2〜4を印刷します
pi.RowStart = 1
pi.RowEnd = 3
'定義したPrintInfoオブジェクトを設定します
FpSpread1.ActiveSheet.PrintInfo = pi
'アクティブシート印刷します
FpSpread1.PrintSheet(FpSpread1.ActiveSheet)
End Sub