Petr
Petr

Reputation: 1219

EPPlus Print Area - column definition

I want to define a list of columns as an Excel PrintArea (by EPPlus, c#). I can define interval (first and last column of area) but I don't know how to define separate columns (for instance: A, C, F, G).

I can set interval like this:

listSheet.PrinterSettings.PrintArea = listSheet.Cells["A,G"];

Upvotes: 4

Views: 5318

Answers (1)

Ernie S
Ernie S

Reputation: 14270

PrintArea is an ExcelRangeBase so you can set it link any other range:

listSheet.PrinterSettings.PrintArea = listSheet.Cells["A:A,G:G"];

Upvotes: 7

Related Questions