{"title":"Report.CreateTotals(Array of [Decimal]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/report/reportinstance-createtotals-decimal-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/report/reportinstance-createtotals-decimal-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/report/reportinstance-createtotals-decimal-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Maintains totals for a variable in AL.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Report.CreateTotals(Array of [Decimal]) Method","slug":"reportcreatetotalsarray-of-decimal-method","at":0,"chars":1480},{"level":2,"title":"Syntax","slug":"syntax","at":190,"chars":67},{"level":2,"title":"Parameters","slug":"parameters","at":257,"chars":204},{"level":2,"title":"Remarks","slug":"remarks","at":461,"chars":707},{"level":2,"title":"Example","slug":"example","at":1168,"chars":178},{"level":2,"title":"Related information","slug":"related-information","at":1346,"chars":134}],"text":"# Report.CreateTotals(Array of [Decimal]) Method\n> Version: _Available or changed with runtime version 1.0 until version 1.0 where it was deprecated._\nMaintains totals for a variable in AL.\n## Syntax\n```al\n Report.CreateTotals(Vars: Array of [Decimal])\n```\n## Parameters\nReport\nType: report-data-type\nAn instance of the report-data-type data type.\nVars\nType: ../decimal/decimal-data-type\nArray of variables for which the system will maintain individual totals.\n## Remarks\n> IMPORTANT\n> This method will be deprecated in a future update and we recommend that you do not use it.\nCreateTOTALS maintains group and grand totals. The totals can be printed by placing controls that have the variable or variables that are the arguments of CreateTOTALS as their source expressions in the appropriate sections. The group totals are printed in GroupFooter sections, and the grand totals are printed in Footer sections.\nThis method is not supported on client report definition \\(RDLC\\) report layouts. In most cases, when you create a layout suggestion for a Classic report layout that uses the CreateTOTALS method, a SUM expression is created instead and no action is required.\n## Example\nThis example shows how to use the CreateTOTALS method to maintain totals for the two variables Amount and Quantity.\n```\nCurrReport.CreateTOTALS(Amount, Quantity);\n```\n## Related information\nreport-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}