{"title":"ThemePart Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-themepart-property/","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/properties/devenv-themepart-property, 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/properties/devenv-themepart-property","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":"Learn how the ThemePart property sets the theme part that gives a Body Word report layout its fonts, colors, and styles in Business Central.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":141,"chars":90},{"level":2,"title":"Remarks","slug":"remarks","at":231,"chars":706},{"level":2,"title":"Example","slug":"example","at":937,"chars":823},{"level":2,"title":"Related information","slug":"related-information","at":1760,"chars":394}],"text":"> Version: _Available or changed with runtime version 18.0._\nSets the layout with the Theme subtype that should be used by this Body layout.\n## Applies to\n Report Layout\n> APPLIES TO: Business Central 2026 release wave 2 and later\n## Remarks\nSet ThemePart on a Word layout that has `SubType = Body`. The value is the name of another layout in the same rendering section of the report. The referenced layout must be a Word layout that has `SubType = Theme`, and it must point to a `.dotx` template file.\nA theme part supplies the fonts, colors, and styles that the Body layout uses when the report renders. Keep your brand formatting in one template, and reference that template from every Body layout that needs it.\nIf ThemePart references a layout that has another type or subtype, the compiler reports an error.\nTo use one theme part across all Body layouts in a report, set the devenv-defaultthemepart-property on the report instead.\n## Example\nThe following example declares a Body layout that gets its fonts, colors, and styles from a separate theme template.\n```al\nreport 50101 \"Customer List Themed\"\n{\n    ApplicationArea = All;\n    UsageCategory = ReportsAndAnalysis;\n    DefaultRenderingLayout = ThemedBody;\n\n    dataset\n    {\n        dataitem(Customer; Customer)\n        {\n            column(Name; Name)\n            {\n            }\n        }\n    }\n\n    rendering\n    {\n        layout(ThemedBody)\n        {\n            Type = Word;\n            SubType = Body;\n            ThemePart = CorporateTheme;\n            LayoutFile = 'Reports/Layouts/ThemedBody.docx';\n        }\n        layout(CorporateTheme)\n        {\n            Type = Word;\n            SubType = Theme;\n            LayoutFile = 'Reports/Layouts/CorporateTheme.dotx';\n        }\n    }\n}\n```\n## Related information\nDeclare report layouts in AL<../devenv-report-layout-declaration>\ndevenv-defaultheaderfooterpart-property\ndevenv-defaultthemepart-property\ndevenv-headerfooterpart-property\ndevenv-defaultrenderinglayout-property\nDefining multiple report layouts<../devenv-multiple-report-layouts>\nGetting started with AL<../devenv-get-started>\nDeveloping extensions<../devenv-dev-overview>"}