-
Notifications
You must be signed in to change notification settings - Fork 276
Breaking Changes in EPPlus 7
Jan Källman edited this page Oct 2, 2024
·
14 revisions
The formula parser has changed significantly in EPPlus 7, requiring all custom functions that are inherited from the ExcelFunction
class to be reviewed.
The ExcelFunction
class has changed, now exposes new properties used to handle array results and condition behaviour.
- The
Execute
method has changed signature changing theIEnumarable
in the first parameter toIList
. New signature is: Execute(IList, ParsingContext). -
ArgumentMinLength
- Required. Minimum number of parameters supplied to the function. Suppling less parameters to the function will result in a #VALUE! error. -
NamespacePrefix
- If the function requires a prefix when saved, for example "_xlfn." or "_xlfn._xlws." -
HasNormalArguments
A Boolean indicating if the formula only has normal arguments. If false, theGetParameterInfo
method must be implemented. The default is true. -
ReturnsReference
- If true the function can return a reference to a range. Use theCreateAddressResult
to return the result with a reference. Returning a reference will cause the dependency chain to check the address and will allow the colon operator to be used with the function. -
IsVolatile
- If the function returns a different result when called with the same parameters. The default is false. -
ArrayBehaviour
- If the function allows arrays as input in a parameter, resulting in an array output. Also see theGetArrayBehaviourConfig
method. - IFunctionModules.CustomCompilers has been removed and compilers can no longer be added. This has been replaced by ExcelFunction.ParameterInfo and ExcelFunction.ArrayBehaviour which configures the new behaviour of the formula calculation engine.
-
CalculateCollection
- has been removed. EPPlus no long uses collections of FunctionArgument in this way. Use theInMemoryRange
class instead. - Converting double's from strings in the formula parser will now use try to parse the string using the the CurrentCulture before trying the InvariantCulture.
- The default value of
ExcelCalculationOption.PrecisionAndRoundingStrategy
in the formula calculation has been changed fromDotNet
toExcel
- The
ErrorHandlingFunction
class has been removed. Use the ParametersInfo property with FunctionParameterInformation.IgnoreErrorInPreExecute instead.
-
CreateAddressResult
- Returns the result with a reference to a range. -
CreateDynamicArrayResult
- The result should be treated as a dynamic array. -
GetArrayBehaviourConfig
- Sets the index if the parameters that can be arrays. Also see theArrayBehaviour
property. The ExcelFunctionArgument class - The
GetAsRangeInfo(ParsingContext)
has been removed. Use theValueAsRangeInfo
property instead. - The
IsEnumerableOfFuncArgs
andValueAsEnumerableOfFuncArgs
properties and has been removed. - The
SetExcelStateFlag
andExcelStateFlagIsSet
methods has been removed. Misspelled propertyExcelIgnoreError.CalculatedColumm
has been renamedCalculatedColumn
- The source code tokenizer now tokenizes in more detail, tokenizing addresses.
- The expression handling is totally rewritten and now uses reversed polish notation instead of an expression tree. This change affects internal classes only.
- The
CompileResult
class has moved to a new namespace: OfficeOpenXml.FormulaParsing.FormulaExpressions - Adding defined names referencing addresses will now be added as fixed addresses (i.e $A$1), unless the
allowRelativeAddress
parameter of theExcelNamedRangeCollection.Add
method is set to true. -
ParsingConfiguration.Lexer
andParsingConfiguration.SetLexer(ILexer lexer)
has been removed. -
ParsingConfiguration.SetExpresionCompiler
has been removed.
- Added
ExcelPackageSettings.ApplyFiltersOnSave
to decide if Filters will be applied on Saving the workbook. Default is True. If set to false, you will call theApplyFilter
method manually to show/hide rows the matches the filters criterias. -
ExcelWorksheet.AutofilterAddress
is now obsolete. UseExcelWorksheet.Autofilter.Address
instead.ExcelWorksheet.Autofilter
will now always be set instead of being null if no autofilter was present.
- Updating ConditionalFormatting via the XML DOM will not work as read and write is performed on load/save.
- The base class
ConditionalFormattingRule
and all derived classes no longer contain the Node property. - Misspelled enum member
eTrendLine.MovingAvgerage
has been removed and replaced witheTrendLine.MovingAverage
- ConditionalFormatting classes are now Internal. Interfaces for each class exist and have all relevant properties instead.
- Renamed misspelled properties
ColSpann
andRowSpann
toColSpan
andRowSpan
on theExcelHyperLink
class.
- Changed class ExcelTextFormatBase to abstract
- OfficeOpenXml.FormulaParsing.ExcelUtilities.ExcelReferenceType RelativeRowAbsolutColumn corrected to RelativeRowAbsoluteColumn
- Removed unused class ParsingScope and ParsingScopes.
- Removed unused interface IParsingLifetimeEventHandler and implemetation.
- Removed implementation of IParsingLifetimeEventHandler.ParsingCompleted in the ParsingContext class.
Also see Breaking Changes in EPPlus 6 and Breaking Changes in EPPlus 5
EPPlus Software AB - https://epplussoftware.com
- What is new in EPPlus 5+
- Breaking Changes in EPPlus 5
- Breaking Changes in EPPlus 6
- Breaking Changes in EPPlus 7
- Addressing a worksheet
- Dimension/Used range
- Copying ranges/sheets
- Insert/Delete
- Filling ranges
- Sorting ranges
- Taking and skipping columns/rows
- Data validation
- Comments
- Freeze and Split Panes
- Header and Footer
- Autofit columns
- Grouping and Ungrouping Rows and Columns
- Formatting and styling
- Conditional formatting
- Using Themes
- Working with custom named table- or slicer- styles