2016-02-02 112 views
5

EEPlusを使用してページを分割する場所を設定する方法はありますか?私は、プリンタのプロパティを設定するが、特定の列にブレークポイントを設定する方法が見つかりませんでした次のコードがあります。EPPlusを使用してワークシートのページレイアウトブレークを設定する方法

// Set printer settings 
ws.PrinterSettings.PaperSize = ePaperSize.Tabloid; 
ws.PrinterSettings.Orientation = eOrientation.Landscape; 
ws.PrinterSettings.FitToPage = true; 
ws.PrinterSettings.FitToHeight = 1; 
ws.PrinterSettings.FooterMargin = .05M; 
ws.PrinterSettings.TopMargin = .05M; 
ws.PrinterSettings.LeftMargin = .05M; 
ws.PrinterSettings.RightMargin = .05M; 

編集(これは私の問題を解決する助けた)

ws.Column(30).PageBreak = true; 
ws.PrinterSettings.PaperSize = ePaperSize.A3; 
ws.PrinterSettings.Orientation = eOrientation.Landscape; 
ws.PrinterSettings.Scale = 75; 

答えて

6

ちょうどおよび/またはColumnオブジェクトへの参照を取得する必要があります。

ws.Row(20).PageBreak = true; 
ws.Column(2).PageBreak = true; 

しかしFitToPageかもしれないことを心に留めておきますこれらを抑制する。

+0

わかりました。 ** FitToPage **はtrueに設定されていますが、** Scale **で作業すると、分割されたページに列が収まるようになりました。 – thatstevedude

関連する問題