Skip to content

Add composite layout theme and header/footer management to the Base A…#8908

Open
v-mortenr wants to merge 1 commit into
microsoft:mainfrom
v-mortenr:features/636293/composite-layout
Open

Add composite layout theme and header/footer management to the Base A…#8908
v-mortenr wants to merge 1 commit into
microsoft:mainfrom
v-mortenr:features/636293/composite-layout

Conversation

@v-mortenr

@v-mortenr v-mortenr commented Jun 30, 2026

Copy link
Copy Markdown

What & why

Adds composite report layouts to the Base Application: a report's Word layout can compose a shared Theme part and a shared Header/Footer part, configured independently and resolved at render time. Parts resolve across four levels — this layout → report default → company → global default — most-specific wins, with theme and header/footer resolved independently. This lets administrators manage branding centrally instead of duplicating it in every layout.

Includes:

  • New Reporting objects (src/Layers/W1/BaseApp/Foundation/Reporting): Composite Layout Lookup Helper (encode/decode part references + resolve the effective theme/header-footer and its source level) and the management/assignment pages (Tenant Report Layout Cfg/Selection, theme & header/footer assignment, new-part dialog, theme-and-header/footer box & list).
  • Report Layouts page and Report Layouts Impl. extended with subtype-aware layout creation (Theme / Header-Footer) and the composite resolver.
  • Company Information surfaced for the shared company metadata (W1 + localization layers).
  • D365 Bus Full Access grants for the new configuration tables.
  • Composite Layout Tests codeunit (resolver precedence + theme/header-footer independence).

Linked work

AB#636293

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • AutomatedComposite Layout Tests codeunit covers: no configuration resolves to None (blank source); resolution and source at each level (this layout / report default / company / global default); header and theme resolving independently from different levels; the more-specific level winning over global; and composite-name encode/decode round-trip (lowercase GUID). Setup is data-agnostic (touches only data it creates).
  • Manual — built the Base Application locally (no new analyzer warnings) and ran in Business Central: configured theme and header/footer parts at the report/company/global levels via the Report Layouts UI, rendered a Word report, and confirmed the header/footer and theme were composed correctly and that resolution falls back to the next level when a part is cleared.

Risk & compatibility

  • Additive — new pages/codeunit, new configuration tables, and additive permission grants; no objects removed and no breaking signature changes (a new InsertNewLayout overload is added; the original is kept).
  • Gated behind the existing Document Report Experience feature key; with no composite parts configured, report rendering is unchanged.
  • Company Information changes span W1 and the localization layers to surface the shared metadata consistently — please sanity-check the localization-layer edits during review.

…pplication

Ports the composite-layout feature (636293) from the internal Base Application:

- New Reporting pages/codeunit for managing theme and header/footer parts and
  per-report / per-company configuration (CompositeLayoutLookupHelper,
  TenantReportLayoutCfg/Selection, theme & header/footer assignment pages).
- Report Layouts page + Report Layouts Impl. extended with subtype-aware
  layout creation and the composite-part resolver.
- Company Information surfaced for the shared company metadata across W1 and
  the localization layers.
- d365busfullaccess permission grants and a Composite Layout Tests codeunit.

AB#636293
@github-actions github-actions Bot added From Fork Pull request is coming from a fork Linked Issue is linked to a Azure Boards work item labels Jun 30, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jun 30, 2026
@v-mortenr

v-mortenr commented Jun 30, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Abakion A/S"

@v-mortenr v-mortenr closed this Jun 30, 2026
@v-mortenr v-mortenr reopened this Jun 30, 2026
@github-actions github-actions Bot added the needs-approval Workflow runs require maintainer approval to start label Jun 30, 2026
@v-mortenr v-mortenr marked this pull request as ready for review June 30, 2026 11:35
@v-mortenr v-mortenr requested a review from a team June 30, 2026 11:35
@PredragMaricic PredragMaricic added SCM GitHub request for SCM area Integration GitHub request for Integration area Finance GitHub request for Finance area labels Jun 30, 2026
@PredragMaricic PredragMaricic requested review from a team June 30, 2026 13:10
}
group(ReportLayoutDefaults)
{
Caption = 'Report Layout Defaults';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the name here should be a bit more generic so that we can use it for other things? I remember (when discussing a different slice with Kennie) that he proposed having a section in Company Information called "Reporting" and he mentioned that your project would need it too. Should we maybe check with him?

@@ -5,6 +5,7 @@

namespace Microsoft.Shared.Report;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: several of these files have .page instead of the usual .Page in their names

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, this one is not new, so no need to rename (but maybe we should keep the convention for the new ones)

ExcelMultipleDataSheets := "Excel Sheet Configuration"::Default;
LayoutName := '';
AvailableInAllCompanies := true;
DocumentReportExperienceEnabled := FeatureKeyManagement.IsDocumentReportExperienceEnabled();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When introducing features like this, since eventually they will be activated by default, we usually wrap them with CLEAN preprocessor symbols so that when the enforcing becomes a reality it becomes straightforward to clean-up the code.

Whenever we branch off say for 29.0, as part of a clean-up we activate the symbol "CLEAN26" (3 releases behind) and if there's any code wrapped between #if not CLEAN26 #endif will go away. In this case you would use CLEAN29 for it to be enforced on 32 (or you check when you want this by default)

See examples of usages of FeatureManagementFacade.IsEnabled, they usually are accompanied by these symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Finance GitHub request for Finance area From Fork Pull request is coming from a fork Integration GitHub request for Integration area Linked Issue is linked to a Azure Boards work item needs-approval Workflow runs require maintainer approval to start SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants