Publisherintermediate

Sub-Templates, Style Templates & Reusability

Explain how sub-templates and style templates promote reuse and consistency across many BI Publisher report layouts.

As a BI Publisher deployment grows to dozens or hundreds of reports, copy-pasting the same header, footer, and formatting logic into every single RTF template becomes an unmaintainable liability — a company logo update or a legal disclaimer change would otherwise require touching every report individually. Interviewers raise this topic to see whether a candidate thinks about template maintainability at scale, not just building one report in isolation.

It's like a company using a shared letterhead template for every department's correspondence instead of each department designing and hand-typing their own header from scratch — update the letterhead once, and every future letter from every department automatically uses the new version.

Key Concepts

1
A sub-template is a reusable RTF fragment (often common headers, footers, standard legal boilerplate, or reusable formatting logic/functions) that's registered once in the BI Publisher catalog and then referenced from any number of parent templates via an <?import:...?> or <?call-template:...?>-style directive, so a single update to the sub-template propagates to every report that includes it, without editing each one individually.
sub-template<?import:...?><?call-template:...?>
2
A style template (sometimes distinguished from a sub-template by convention) focuses specifically on shared visual styling — consistent fonts, colors, table borders, and branding elements — so that a company-wide rebrand (new logo, new color palette) is a one-file change rather than a mass edit across the entire report catalog. Style templates are especially valuable in large enterprises running BIP across many departments where consistent corporate branding is a compliance/brand-guideline requirement, not just a nicety.
style template
3
A good interview answer also connects this to template inheritance/versioning practices: sub-templates should themselves be version-controlled and tested before rollout, since a bug introduced into a widely-shared sub-template can simultaneously break dozens of production reports at once — the blast radius of a shared component is the trade-off for its reuse benefit.
template inheritance/versioning practices