AutoFormatExpr and AutoFormatType

Since NAV 2015 and later, using AutoFormatExpr and AutoFormatType on report columns has not produced the right results. This is because the functionality in Microsoft Dynamics NAV and Microsoft Dynamics 365 Business Central calling AutoFormatTranslate has been partly broken.

Because of this, ForNAV now supports calling AutoFormatTranslate and using it to call Format directly by introducing a new function: ReportForNav.AutoFormat(decimal,autoFormatExpr,autoFormatType).

To enable this functionality automatically, the ForNAV Converter includes the Convert AutoFormat properties to function calls check box:

When you select this check box, the ForNAV Converter converts the columns’ expression into a function call using the values of AutoFormatExpr and AutoFormatType as parameters.

For example:

SourceExpr = “Line Amount”, AutoFormatExpr = “Sales Invoice Line”.GetCurrencyCode, and AutoFormatType = 1

will be converted into: ReportForNav.AutoFormat(“Line Amount”,”Sales Invoice Line”.GetCurrencyCode,1)

If you later want NAV to call AutoFormatTranslate (if Microsoft fixes the issues) you must change the expression back to “Line Amount” manually. We will not touch the AutoFormatExpr and AutoFormatType properties – but they will not have any function because ReportForNav.AutoFormat returns a string that is ignored by AutoFormatTranslate.