private void Form1_Load(object sender, EventArgs e)
{
for (int i = 0; i < 15; i++)
{
for (int j = 0; j < 15; j++)
{
fpSpread1.ActiveSheet.SetValue(i, j, String.Format("R{0}C{1}", i, j));
}
}
// 余白の指定
fpSpread1.ActiveSheet.PrintInfo.Margin.Left = 30;
fpSpread1.ActiveSheet.PrintInfo.Margin.Top = 30;
}
private void button1_Click(object sender, EventArgs e)
{
// 物理マージンの値をPrintInfoの値に加算します
System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument();
fpSpread1.ActiveSheet.PrintInfo.Margin.Left += (int)pd.DefaultPageSettings.HardMarginX;
fpSpread1.ActiveSheet.PrintInfo.Margin.Top += (int)pd.DefaultPageSettings.HardMarginY;
// シートを印刷
fpSpread1.PrintSheet(0);
}
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For i As Integer = 0 To 15 - 1
For j As Integer = 0 To 15 - 1
FpSpread1.ActiveSheet.SetValue(i, j, String.Format("R{0}C{1}", i, j))
Next
Next
' 余白の指定
FpSpread1.ActiveSheet.PrintInfo.Margin.Left = 30
FpSpread1.ActiveSheet.PrintInfo.Margin.Top = 30
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' 物理マージンの値をPrintInfoの値に加算します
Dim pd As New System.Drawing.Printing.PrintDocument
FpSpread1.ActiveSheet.PrintInfo.Margin.Left += pd.DefaultPageSettings.HardMarginX
FpSpread1.ActiveSheet.PrintInfo.Margin.Top += pd.DefaultPageSettings.HardMarginY
' シートを印刷
FpSpread1.PrintSheet(0)
End Sub