Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EPPlus support for sheet right to left alignment

Tags:

c#

epplus

Excel right to left alignment

what is the equivalent in EPPlus to using sheet right to left alignment in Excel , the only thing that comes close to that is ExcelReadingOrder.RightToLeft but it doesn't seem to set the alignment for the whole sheet

like image 587
Mohammed Kamil Avatar asked Jan 22 '16 14:01

Mohammed Kamil


People also ask

Does EPPlus support XLSM?

Reads and writes xlsx, xlsm. Please note that EPPlus does not support the xlsx Strict format.

Does EPPlus use Openxml?

EPPlus is a . net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx).

Does EPPlus require Excel?

No, it does not require Excel to be installed on the server, as you can read in the docs: EPPlus is a . NET library that reads and writes Excel files using the Office Open XML format (xlsx).


1 Answers

I think you want to set the View object of the worksheet:

using (var package = new ExcelPackage(fileinfo))
{
    var workbook = package.Workbook;
    var worksheet = workbook.Worksheets.Add("RightToLeft");

    //Set the worksheet right-to-left
    worksheet.View.RightToLeft = true;

    package.Save();
}
like image 161
Ernie S Avatar answered Sep 24 '22 09:09

Ernie S