You are here:
Sample Report Layout
The Order Confirmation PDF layout is designed as a structured, multi-section document.
Required Editions
| Available in Lightning Experience in Enterprise and Unlimited Editions that have Consumer Goods Cloud enabled. |
The Order Confirmation PDF layout is structured within a PrintLayout root node that separates data binding (Declarations) from the visual definition (ReportLayout) to create a professional transaction document. It opens with a branded header displaying company and customer details, organized into distinct grids using table elements. The main body dynamically populates itemized lists for products, returns, and empties using each loops, filters, and correlation nodes to handle complex data like pricing and quantities across separate sections. The layout wraps up with summary totals and a signature block, relying on defined styles and img tags to ensure a consistent, polished appearance throughout.
<PrintLayout xmlns="https://www.salesforce.com/cgcloud/xsds" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="OrderConfirmationPDF">
<Declarations>
<DataDeclaration name="order" type="BoOrder"/>
<DataDeclaration name="salesOrg" type="LuSalesOrg"/>
<DataDeclaration name="myImageName" type="Image" mimeType="image/png" imageId="CompanyLogo"/>
<DataDeclaration name="textItems" type="BoOrderPrintTextItems"/>
<DataDeclaration name="signature1" type="Signature"/>
</Declarations>
<ReportLayout pageMargins="[40,40,40,40]">
<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>
<!--
Manufacturer Table
-->
<table name="ManufacturerTable" dontBreakRows="false" tableLayout="noBorders">
<tbody>
<tr>
<td width="260" alignment="center" rowSpan="6">
<img src="{{Declarations::myImageName}}" width="100"/>
</td>
<td width="100"/>
<td width="130" alignment="left" bold="true">{{Declarations::salesOrg.text}}</td>
</tr>
<tr>
<td alignment="right">{{Labels::AddressId; defaultLabel=Address:}}</td>
<td>{{Declarations::salesOrg.houseNumber}} {{Declarations::salesOrg.street}}
{{Declarations::salesOrg.zipCode}} {{Declarations::salesOrg.city}}
</td>
</tr>
<tr>
<td alignment="right">{{Labels::PhoneId; defaultLabel=Phone:}}</td>
<td>{{Declarations::salesOrg.phone1}}</td>
</tr>
<tr>
<td alignment="right">{{Labels::FaxId; defaultLabel=Fax:}}</td>
<td>{{Declarations::salesOrg.fax1}}</td>
</tr>
<tr>
<td alignment="right">{{Labels::TINId; defaultLabel=Tax Id:}}</td>
<td>{{Declarations::salesOrg.taxJurisdictionCode}}</td>
</tr>
<tr>
<td alignment="right">{{Labels::BankAccId; defaultLabel=Bank Account:}}</td>
<td>{{Declarations::salesOrg.accountNumber}}</td>
</tr>
</tbody>
</table>
<!--
Header Table
-->
<table name="HeaderTable" tableLayout="noBorders">
<tbody>
<tr>
<td width="100" alignment="right"/>
<td width="152" bold="true">{{Declarations::order.luDeliveryRecipient.name}}</td>
<td width="100" alignment="right">{{Labels::DocumentNoId; defaultLabel=Document No.:}}</td>
<td width="130">{{Declarations::order.orderId}}</td>
</tr>
<tr>
<td alignment="right">{{Labels::CustomerAddressId; defaultLabel=Address:}}</td>
<td bold="true">{{Declarations::order.luDeliveryRecipient.street}}
{{Declarations::order.luDeliveryRecipient.houseNumber}}
</td>
<td alignment="right">{{Labels::OrderStatusId; defaultLabel=Order Status:}}</td>
<td>{{Declarations::order.phaseText;}}</td>
</tr>
<tr>
<td alignment="right"/>
<td bold="true">{{Declarations::order.luDeliveryRecipient.zipCode}}
{{Declarations::order.luDeliveryRecipient.city}}
</td>
<td alignment="right">{{Labels::DeliveryDateId; defaultLabel=Delivery Date:}}</td>
<td>{{Declarations::order.deliveryDate; dateTimeFormat=date}}</td>
</tr>
<tr>
<td alignment="right"/>
<td bold="true">{{Declarations::order.luDeliveryRecipient.countryState}}</td>
<td alignment="right">{{Labels::CustomerCommitDateId; defaultLabel=Order Date:}}</td>
<td>{{Declarations::order.commitDate; dateTimeFormat=date}}</td>
</tr>
<tr>
<td alignment="right">{{Labels::CustomerPhoneId; defaultLabel=Phone:}}</td>
<td>{{Declarations::order.luDeliveryRecipient.phone1}}</td>
<td alignment="right">{{Labels::SalesRepId; defaultLabel=Sales Rep:}}</td>
<td>{{Declarations::order.luResponsible.name}}</td>
</tr>
<tr>
<td alignment="right">{{Labels::CustomerNumberId; defaultLabel=Customer:}}</td>
<td>{{Declarations::order.luDeliveryRecipient.customerNumber}}</td>
<td alignment="right"/>
<td/>
</tr>
<tr>
<td alignment="right">{{Labels::CustomerOrderId; defaultLabel=Cust. PO No.:}}</td>
<td>{{Declarations::order.customerOrderId}}</td>
<td alignment="right"/>
<td/>
</tr>
</tbody>
</table>
<!--
Order Items
-->
<h1>Sample heading 1</h1>
<h2 alignment="center">{{Labels::OderConfirmationId; defaultLabel=Order Confirmation}}</h2>
<table tableLayout="lightHorizontalLinesMainItemsOnly" name="OrderItemsTable">
<thead>
<tr>
<th width="75">{{Labels::PrdNumberId; defaultLabel=No.}}</th>
<th width="*">{{Labels::TextId; defaultLabel=Product}}</th>
<th width="25" alignment="center">{{Labels::UnitId; defaultLabel=Unit}}</th>
<th width="25" alignment="center">{{Labels::QuantityId; defaultLabel=Qty}}</th>
<th width="40" alignment="center">{{Labels::UnitPriceId; defaultLabel=Unit Price}}</th>
<th width="48" alignment="center">{{Labels::FullAmountId; defaultLabel=Full Amount}}</th>
<th width="48" alignment="center">{{Labels::NettoAmountId; defaultLabel=Net. Amount}}</th>
<th width="18" alignment="center">{{Labels::TaxClassificationId; defaultLabel=T}}</th>
</tr>
</thead>
<tbody>
<each name="itemsEach" value="{{Declarations::order.loPrintItems}}">
<filters>
<filter fieldName="quantity" value="0" operator="GT" compareMode="NUMBER"/>
<filter fieldName="movementDirection" value="In" operator="NE"/>
</filters>
<orderCriteria>
<orderCriterion fieldName="prdId" direction="ASC" compareMode="NUMBER"/>
</orderCriteria>
<tr>
<td>{{.prdId}}</td>
<td>{{.text1}}</td>
<td alignment="center">{{.quantityLogisticUnit; toggleId=DomPrdLogisticUnit;
toggleField=shortText}}
</td>
<td alignment="right">{{.quantity}}</td>
<td alignment="right">{{.basePriceReceipt; numberFormat=8.2}}</td>
<td alignment="right">{{.grossValueReceipt; numberFormat=8.2}}</td>
<td alignment="right">{{.valueReceipt; numberFormat=8.2}}</td>
<td alignment="center">{{.taxClassification; toggleId=DomTaxClassification;
toggleField=shortText}}
</td>
</tr>
<correlation name="correlation1" value="{{Declarations::order.loSdoConditions}}" key="pKey"
correlationKey="sdoItemPKey">
<filters>
<filter fieldName="sdoItemPKey" value=" " operator="NE"/>
<filter fieldName="cpIsPrintRelevant" value="1" operator="EQ"/>
</filters>
<tr>
<td/>
<td italics="true" colSpan="7">{{path=.text1}} {{.conditionValue; numberFormat=8.2}}
{{.conditionResult; numberFormat=8.2}}
</td>
</tr>
</correlation>
</each>
<tr>
<td colSpan="3" alignment="center">{{Labels::TotalId; defaultLabel=Total}}</td>
<td alignment="right">
<sum table="OrderItemsTable" col="3"/>
</td>
<td colSpan="2"/>
<td alignment="right">
<sum table="OrderItemsTable" col="6" numberFormat="8.2"/>
</td>
<td/>
</tr>
</tbody>
</table>
<!--
Returns
-->
<p bold="true">{{Labels::ReturnedItemsLabelId; defaultLabel=Returns}}</p>
<table tableLayout="lightHorizontalLinesMainItemsOnly" name="ReturnsTable">
<thead>
<tr>
<th width="75">{{Labels::PrdNumberId; defaultLabel=No.}}</th>
<th width="*">{{Labels::TextId; defaultLabel=Product}}</th>
<th width="25" alignment="center">{{Labels::UnitId; defaultLabel=Unit}}</th>
<th width="25" alignment="center">{{Labels::QuantityId; defaultLabel=Qty}}</th>
<th width="40" alignment="center">{{Labels::UnitPriceId; defaultLabel=Unit Price}}</th>
<th width="48" alignment="center">{{Labels::FullAmountId; defaultLabel=Full Amount}}</th>
<th width="48" alignment="center">{{Labels::NettoAmountId; defaultLabel=Net. Amount}}</th>
<th width="18" alignment="center">{{Labels::TaxClassificationId; defaultLabel=T}}</th>
</tr>
</thead>
<tbody>
<each name="ReturnEach" value="{{Declarations::order.loPrintItems}}">
<filters>
<filter fieldName="quantity" value="0" operator="GT" compareMode="NUMBER"/>
<filter fieldName="movementDirection" value="In" operator="EQ"/>
</filters>
<orderCriteria>
<orderCriterion fieldName="prdId" direction="ASC" compareMode="NUMBER"/>
</orderCriteria>
<tr>
<td>{{.prdId}}</td>
<td>{{.text1}}</td>
<td alignment="center">{{.quantityLogisticUnit; toggleId=DomPrdLogisticUnit;
toggleField=shortText}}
</td>
<td alignment="right">{{.quantity}}</td>
<td alignment="right">{{.basePriceReceipt; numberFormat=8.2}}</td>
<td alignment="right">{{.grossValueReceipt; numberFormat=8.2}}</td>
<td alignment="right">{{.valueReceipt; numberFormat=8.2}}</td>
<td alignment="center">{{.taxClassification; toggleId=DomTaxClassification;
toggleField=shortText}}
</td>
</tr>
<correlation name="correlation2" value="{{Declarations::order.loSdoConditions}}" key="pKey"
correlationKey="sdoItemPKey">
<filters>
<filter fieldName="sdoItemPKey" value=" " operator="NE"/>
<filter fieldName="cpIsPrintRelevant" value="1" operator="EQ"/>
</filters>
<tr>
<td/>
<td italics="true" colSpan="7">{{path=.text1}} {{.conditionValue; numberFormat=8.2}}
{{.conditionResult; numberFormat=8.2}}
</td>
</tr>
</correlation>
</each>
<tr>
<td colSpan="3" alignment="center">{{Labels::ReturnTotalProductsId; defaultLabel=Total Returns}}
</td>
<td alignment="right">
<sum table="ReturnsTable" col="3"/>
</td>
<td colSpan="2"/>
<td alignment="right">
<sum table="ReturnsTable" col="6" numberFormat="8.2"/>
</td>
<td/>
</tr>
</tbody>
</table>
<!--
s
Header Conditions
-->
<p bold="true">{{Labels::HeaderConditionsLabelId; defaultLabel=Header Conditions}}</p>
<table tableLayout="noBorders" name="HeaderConditionsTable">
<tbody>
<each name="headerEach" value="{{Declarations::order.loSdoConditions}}">
<filters>
<filter fieldName="sdoItemPKey" value=" " operator="EQ"/>
<filter fieldName="cpIsPrintRelevant" value="1" operator="EQ"/>
<!-- As discussed with PO filter of header condition filters out empties total hard coded -->
<filter fieldName="cndCpMetaPKey" value="00100000007hnjlk" operator="NE"/>
</filters>
<orderCriteria>
<orderCriterion fieldName="cndCpCalculationPosition" direction="ASC"/>
</orderCriteria>
<tr>
<td width="85"/>
<td width="255">{{.text1}}</td>
<td width="auto" alignment="right">{{.conditionValue; numberFormat=8.2}}</td>
<td width="auto" alignment="right">{{.conditionResult; numberFormat=8.2}}</td>
<td width="auto" alignment="left">{{Declarations::order.currency}}</td>
</tr>
</each>
</tbody>
</table>
<!--
Empties Table
-->
<p bold="true">{{Labels::EmtiesGridTitleId; defaultLabel=Empties}}</p>
<table tableLayout="lightHorizontalLines" name="EmptiesTable">
<thead>
<tr>
<th width="85">{{Labels::PrdNumberId; defaultLabel=No.}}</th>
<th width="*">{{Labels::TextEmptyId; defaultLabel=Empties}}</th>
<th width="40" alignment="right">{{Labels::DeliveredEmptiesId; defaultLabel=Del.}}</th>
<th width="40" alignment="right">{{Labels::ReturnedEmptiesId; defaultLabel=Ret.}}</th>
<th width="40" alignment="right">{{Labels::TotalQuantityEmptiesId; defaultLabel=Qty}}</th>
<th width="18" alignment="center">{{Labels::TaxClassificationId; defaultLabel=T}}</th>
</tr>
</thead>
<tbody>
<each name="emptiesEach" value="{{Declarations::order.loEmptiesForPrintout}}">
<orderCriteria>
<orderCriterion fieldName="prdId" direction="ASC"/>
</orderCriteria>
<tr>
<td>{{.prdId}}</td>
<td>{{.text1}}</td>
<td alignment="right">{{.quantityDelivered}}</td>
<td alignment="right">{{.quantityReturned}}</td>
<td alignment="right">{{.totalQuantity}}</td>
<td alignment="center">{{.taxClassification}}</td>
</tr>
</each>
<tr>
<td colSpan="4" alignment="right">{{Labels::SumEmptiesLabelId; defaultLabel=Total Empties}}</td>
<td alignment="right">
<sum table="EmptiesTable" col="4"/>
</td>
<td/>
</tr>
<!--
<tr>
<td colSpan="4" alignment="right">{{Declarations::order.emptiesTotalText}}</td>
<td alignment="right">{{Declarations::order.emptiesTotalAmount}} {{Declarations::order.emptiesTotalCurrency}}</td>
<td></td>
</tr>
-->
</tbody>
</table>
<!--
Total Table
-->
<table tableLayout="noBorders" name="TotalTable">
<thead>
<tr>
<th width="*"/>
<th width="auto" alignment="right"/>
<th width="auto" alignment="right"/>
</tr>
</thead>
<tbody>
<tr>
<td/>
<td alignment="right">{{Labels::TotalPrdId; defaultLabel=Total Products and Other Items}}</td>
<td alignment="right">{{Declarations::order.totalValueReceipt; numberFormat=8.2}}
{{Declarations::order.currency}}
</td>
</tr>
<tr>
<td/>
<td bold="true" alignment="right">{{Labels::TotalAmountId; defaultLabel=Total Amount}}</td>
<td bold="true" alignment="right">{{Declarations::order.grossTotalValueReceipt; numberFormat=8.2}}
{{Declarations::order.currency}}
</td>
</tr>
</tbody>
</table>
<!--
Signature Table
-->
<table name="SignatureTable" tableLayout="noBorders">
<tbody>
<tr>
<td width="160" alignment="center">
<img src="{{Declarations::signature1}}" width="160" alignment="left"/>
</td>
<td width="100"/>
<td width="160"/>
</tr>
<tr>
<td>{{Declarations::textItems.signature1Name}}</td>
<td/>
<td/>
</tr>
</tbody>
</table>
<p>{{Declarations::salesOrg.legalInformation}}</p>
<p>{{Declarations::textItems.endOfPrint}}</p>
</ReportLayout>
</PrintLayout>
