Loading
Feature Disruption - Service Cloud VoiceRead More
Feature degradation | Gmail Email delivery failureRead More
Visual Studio Code Based Modeler for Consumer Goods Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Design Document Layout

          Design Document Layout

          Define the header, footer, page numbers, page layout, and other properties that can be printed on the pages of a PDF document.

          Required Editions

          Available in Lightning Experience in Enterprise and Unlimited Editions that have Consumer Goods Cloud enabled.

          ReportLayout

          The attributes supported by the ReportLayout element are:

          Attribute Description Values/Pattern Required
          pageSize

          Defines the page layout of the document, which is case-sensitive. The default value is A4. The other supported page layouts are A5, EXECUTIVE, FOLIO, LEGAL, LETTER, TABLOID.

          Specify pageSize with an array of width and height in points (1 inch = 72 points) in this format pageSize="[<width>, <height>]". Specify height value in integer or auto. For example, in pageSize="[216, auto]"

          String No
          pageMargins

          Defines the page margin for the document in one of the following formats. The default value is [40, 60, 40, 60].

          • [left, top, right, bottom]
          • [horizontal, vertical]
          String No

          The ReportLayout element supports these child elements:

          • table
          • img
          • p
          • header
          • footer
          • h1
          • h2
          • styles

          Use the styles node to change default formatting. The style you create for an elements will apply to all occurances of that element in your print layout. You can set the style name to paragraph, tableBody, tableHeader, heading1, and heading2. You may also choose to specify attributes such as font size, margin, bold, and italics. The styles node configuration doesn't work with 3" Bluetooth thermal printers.

          Sample Code

          This sample layout for a report includes a header with an image and a table, main title Order Confirmation, a styled subheading for Reference, and a bold paragraph with a default subtext.

          <ReportLayout>
              <header>
                <img src="{{Declarations::myImageName}}" width="10" />
                <table name="headerTable">
                  <thead>
                    <tr>
                      <th width="auto">{{Declarations::header.printType}}</th>
                      <th width="auto">{{Declarations::header.text}}</th>
                    </tr>
                  </thead>
                  <tbody></tbody>
                </table>
              </header>
              <h1>Order Confirmation</h1>
              <h2 alignment="left" bold="true" italics="true"> Reference </h2>
              <p bold="true">{{Labels::subtext; defaultLabel=This is the subtext2}}</p>

          This sample ‌layout for a report sets the margins and page size, and sets different styles for paragraphs, table bodies, table headers, and headings. It also sets font sizes, and bold and italic formatting.

          <ReportLayout pageMargins="[40,40,40,40]" pageSize="[216, auto]">
                   <styles>
                      <style name="paragraph" fontSize="16" bold="true"/>
                      <style name="tableBody" margin="[0,2,0,2]" italics="true"/>
                      <style name="tableHeader" fontSize="18" bold="false"/>
                      <style name="heading1" fontSize="30" italics="true" bold="false"/>
                      <style name="heading2" fontSize="25"/>
                   </styles>
          • Table Header
            Define a header cell in the table.
          • Table Cell
            Define a standard cell for data in a table. Adjust the settings to stretch the cell horizontally across columns or vertically across rows to customize your layout.
          • Headings (H1, H2)
            The h1 element creates a main heading and the h2 element creates a sub-heading for a document.
          • Textual Data
            Define labels, data, or any sequence of terms that belong to a document. This element does not contain any attribute or child element. It supports the macros feature.
          • Paragraph
            The p element creates a paragraph in the document.
          • Add Header, Footer, and Page Number to PDF
            Define headers, footers, and page numbers to enhance readability and organization of your PDF documents.
          • Sample Report Layout
            The Order Confirmation PDF layout is designed as a structured, multi-section document.
           
          Loading
          Salesforce Help | Article