Class CalculationExtension
- Namespace
- OfficeOpenXml
- Assembly
- EPPlus.dll
Extentions methods for formula calculation.
public static class CalculationExtension
- Inheritance
-
CalculationExtension
- Inherited Members
Methods
Calculate(ExcelRangeBase)
Calculate all formulas in the current range
public static void Calculate(this ExcelRangeBase range)
Parameters
range
ExcelRangeBaseThe range
Calculate(ExcelRangeBase, ExcelCalculationOption)
Calculate all formulas in the current range
public static void Calculate(this ExcelRangeBase range, ExcelCalculationOption options)
Parameters
range
ExcelRangeBaseThe range
options
ExcelCalculationOptionCalculation options
Calculate(ExcelRangeBase, Action<ExcelCalculationOption>)
Calculate all formulas in the current range
public static void Calculate(this ExcelRangeBase range, Action<ExcelCalculationOption> configHandler)
Parameters
range
ExcelRangeBaseThe range to calculate
configHandler
Action<ExcelCalculationOption>Configuration handler
Examples
sheet.Cells["A1:A3"].Calculate(opt => opt.PrecisionAndRoundingStrategy = PrecisionAndRoundingStrategy.Excel);
Calculate(ExcelWorkbook)
Calculate all formulas in the current workbook
public static void Calculate(this ExcelWorkbook workbook)
Parameters
workbook
ExcelWorkbookThe workbook
Calculate(ExcelWorkbook, ExcelCalculationOption)
Calculate all formulas in the current workbook
public static void Calculate(this ExcelWorkbook workbook, ExcelCalculationOption options)
Parameters
workbook
ExcelWorkbookThe workbook
options
ExcelCalculationOptionCalculation options
Calculate(ExcelWorkbook, Action<ExcelCalculationOption>)
Calculate all formulas in the current workbook
public static void Calculate(this ExcelWorkbook workbook, Action<ExcelCalculationOption> configHandler)
Parameters
workbook
ExcelWorkbookThe workbook to calculate
configHandler
Action<ExcelCalculationOption>Configuration handler
Examples
workbook.Calculate(opt => opt.PrecisionAndRoundingStrategy = PrecisionAndRoundingStrategy.Excel);
Calculate(ExcelWorksheet)
Calculate all formulas in the current worksheet
public static void Calculate(this ExcelWorksheet worksheet)
Parameters
worksheet
ExcelWorksheetThe worksheet
Calculate(ExcelWorksheet, ExcelCalculationOption)
Calculate all formulas in the current worksheet
public static void Calculate(this ExcelWorksheet worksheet, ExcelCalculationOption options)
Parameters
worksheet
ExcelWorksheetThe worksheet
options
ExcelCalculationOptionCalculation options
Calculate(ExcelWorksheet, Action<ExcelCalculationOption>)
Calculate all formulas in the current range
public static void Calculate(this ExcelWorksheet worksheet, Action<ExcelCalculationOption> configHandler)
Parameters
worksheet
ExcelWorksheetThe worksheet to calculate
configHandler
Action<ExcelCalculationOption>Configuration handler
Examples
sheet.Calculate(opt => opt.PrecisionAndRoundingStrategy = PrecisionAndRoundingStrategy.Excel);
Calculate(ExcelWorksheet, string)
Calculate all formulas in the current range
public static object Calculate(this ExcelWorksheet worksheet, string Formula)
Parameters
worksheet
ExcelWorksheetThe worksheet
Formula
stringThe formula to be calculated
Returns
- object
The result of the formula calculation
Calculate(ExcelWorksheet, string, ExcelCalculationOption)
Calculate all formulas in the current range
public static object Calculate(this ExcelWorksheet worksheet, string Formula, ExcelCalculationOption options)
Parameters
worksheet
ExcelWorksheetThe worksheet
Formula
stringThe formula to be calculated
options
ExcelCalculationOptionCalculation options
Returns
- object
The result of the formula calculation