Thursday, August 2, 2012

How to change the orientation of excel worksheet in EPPlus

It is very easy to change the orientation of the Excel sheet while using EPPlus library. This is often necessary when one needs to check the print preview of the generated excel file.

Suppose, your worksheet variable name is ws then,
ws.PrinterSettings.Orientation = eOrientation.Landscape.

Thats it. It is a simple one-liner.

3 comments: