代码如下:
Public Shared Sub PrintInfo(ByVal fpSpread As FpSpread)
' 印刷時の設定
' アクティブなシートを一枚目に設定
fpSpread.ActiveSheetViewIndex = 0
For i = 0 To fpSpread.Sheets.Count - 1
' ページサイズを設定
fpSpread.ActiveSheetView.PageSize = fpSpread.ActiveSheetView.RowCount
' 印刷の向き設定(横)
fpSpread.ActiveSheetView.PrintInfo.Orientation = PrintOrientation.Landscape
' 輪郭線の非表示
fpSpread.ActiveSheetView.PrintInfo.ShowBorder = False
' 印刷時のグリッド線非表示
fpSpread.ActiveSheetView.PrintInfo.ShowGrid = False
' 印刷縮尺
fpSpread.ActiveSheetView.PrintInfo.UseSmartPrint = True
fpSpread.ActiveSheetView.PrintInfo.SmartPrintPagesWide = 1
fpSpread.ActiveSheetView.PrintInfo.SmartPrintPagesTall = 0
' 印刷位置
fpSpread.ActiveSheetView.PrintInfo.Centering = Centering.Horizontal
' 印刷時のヘッダ非表示
fpSpread.ActiveSheetView.PrintInfo.ShowColumnHeader = PrintHeader.Hide
fpSpread.ActiveSheetView.PrintInfo.ShowRowHeader = PrintHeader.Hide
' 次のシートを選択
fpSpread.ActiveSheetViewIndex += 1
Next
fpSpread.ActiveSheetViewIndex = 0
End Sub |