Sample Print Layout for 3-inch Endless Paper Print on Bluetooth Thermal Printer
This sample print configuration defines a layout for a Direct Credit Order PDF.
Required Editions
| Available in: Lightning Experience in Enterprise and Unlimited Editions that have Consumer Goods Cloud enabled |
This sample layout includes declarations for various data types such as the order, sales organization details, image, text items, and signature. The layout consists of headers, tables for manufacturer and header information, order items with product details, quantities, prices, and totals. It also includes a table for total values, payment method, paid amount, balance, and legal information. The layout is designed with specific alignments, formatting, and data references to create a structured and informative PDF document for direct credit orders.
<PrintLayout xmlns="https://www.salesforce.com/cgcloud/xsds" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="DirectCreditOrderPDF">
<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 pageSize="[216, auto]">
<h1>Header 1</h1>
<h2 alignment="center">Header 2</h2>
<img src="{{Declarations::myImageName}}" width="100" alignment="center" />
<lineFeed />
<!--Manufacturer Table-->
<table name="ManufacturerTable" tableLayout="noBorders">
<thead>
<tr>
<th width="40%" alignment="right"></th>
<th width="60%" alignment="left"></th>
</tr>
</thead>
<tbody>
<tr>
<td>{{Labels::AddressId; defaultLabel=Address:}}</td>
<td>{{Declarations::salesOrg.houseNumber}} {{Declarations::salesOrg.street}} {{Declarations::salesOrg.zipCode}} {{Declarations::salesOrg.city}}</td>
</tr>
<tr>
<td>{{Labels::PhoneId; defaultLabel=Phone:}}</td>
<td>{{Declarations::salesOrg.phone1}}</td>
</tr>
<tr>
<td>{{Labels::FaxId; defaultLabel=Fax:}}</td>
<td>{{Declarations::salesOrg.fax1}}</td>
</tr>
<tr>
<td>{{Labels::TINId; defaultLabel=Tax Id:}}</td>
<td>{{Declarations::salesOrg.taxJurisdictionCode}}</td>
</tr>
<tr>
<td>{{Labels::BankAccId; defaultLabel=Bank Account:}}</td>
<td>{{Declarations::salesOrg.accountNumber}}</td>
</tr>
</tbody>
</table>
<lineFeed />
<!--Header Table-->
<table name="HeaderTable" tableLayout="noBorders">
<thead>
<tr>
<th width="40%" alignment="right"></th>
<th width="60%" alignment="left"></th>
</tr>
</thead>
<tbody>
<tr>
<td />
<td>{{Declarations::order.luDeliveryRecipient.name}}</td>
</tr>
<tr>
<td>{{Labels::CustomerAddressId; defaultLabel=Address:}}</td>
<td>{{Declarations::order.luDeliveryRecipient.street}} {{Declarations::order.luDeliveryRecipient.houseNumber}}</td>
</tr>
<tr>
<td />
<td>{{Declarations::order.luDeliveryRecipient.zipCode}} {{Declarations::order.luDeliveryRecipient.city}}</td>
</tr>
<tr>
<td />
<td>{{Declarations::order.luDeliveryRecipient.countryState}}</td>
</tr>
<tr>
<td>{{Labels::CustomerPhoneId; defaultLabel=Phone:}}</td>
<td>{{Declarations::order.luDeliveryRecipient.phone1}}</td>
</tr>
<tr>
<td>{{Labels::CustomerNumberId; defaultLabel=Customer:}}</td>
<td>{{Declarations::order.luDeliveryRecipient.customerNumber}}</td>
</tr>
<tr>
<td>{{Labels::CustomerOrderId; defaultLabel=Cust. PO No.:}}</td>
<td>{{Declarations::order.customerOrderId}}</td>
</tr>
</tbody>
</table>
<lineFeed />
<!--Order Items-->
<h2 alignment="center">{{Labels::OderConfirmationId; defaultLabel=Order Confirmation}}</h2>
<lineFeed />
<table tableLayout="lightHorizontalLinesMainItemsOnly" name="OrderItemsTable">
<thead>
<tr>
<th alignment="left" width="45%">{{Labels::TextId; defaultLabel=Product}}</th>
<th alignment="center" width="10%">{{Labels::QuantityId; defaultLabel=Qty}}</th>
<th alignment="center" width="20%">{{Labels::UnitPriceId; defaultLabel=Unit Price}}</th>
<th alignment="right" width="25%">{{Labels::NettoAmountId; defaultLabel=Net. Amount}}</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>{{.text1}}</td>
<td>{{.quantity}}</td>
<td>{{.basePriceReceipt; numberFormat=8.2}}</td>
<td>{{.valueReceipt; numberFormat=8.2}}</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>{{path=.text1}} {{.conditionValue; numberFormat=8.2}} {{.conditionResult; numberFormat=8.2}}</td>
</tr>
</correlation>
</each>
<tr>
<td>{{Labels::TotalId; defaultLabel=Total}}</td>
<td><sum table="OrderItemsTable" col="1" /></td>
<td />
<td><sum table="OrderItemsTable" col="3" numberFormat="8.2" /></td>
</tr>
</tbody>
</table>
<!-- Total Table-->
<table tableLayout="noBorders" name="TotalTable">
<thead>
<tr>
<th width="30%" />
<th width="40%" alignment="right" />
<th width="30%" alignment="left" />
</tr>
</thead>
<tbody>
<tr>
<td />
<td>{{Labels::TotalPrdId; defaultLabel=Total Products and Other Items}}</td>
<td>{{Declarations::order.totalValueReceipt; numberFormat=8.2}} {{Declarations::order.currency}}</td>
</tr>
<tr>
<td />
<td>{{Labels::TotalAmountId; defaultLabel=Total Amount}}</td>
<td>{{Declarations::order.grossTotalValueReceipt; numberFormat=8.2}} {{Declarations::order.currency}}</td>
</tr>
<tr>
<td />
<td>{{Labels::PaymentMethodId; defaultLabel=Payment Method}}</td>
<td>{{Declarations::order.paymentMethodText;}}</td>
</tr>
<tr>
<td />
<td>{{Labels::TotalPaidAmountId; defaultLabel=Total Paid Amount}}</td>
<td>{{Declarations::order.paidAmountReceipt; numberFormat=8.2}} {{Declarations::order.currency}}</td>
</tr>
<tr>
<td />
<td>{{Labels::BalanceId; defaultLabel=Balance}}</td>
<td>{{Declarations::order.balance; numberFormat=8.2}} {{Declarations::order.currency}}</td>
</tr>
</tbody>
</table>
<img src="{{Declarations::signature1}}" width="160" alignment="left" />
<p>{{Declarations::salesOrg.legalInformation}}</p>
<p>{{Declarations::textItems.endOfPrint}}</p>
<lineFeed />
<lineFeed />
</ReportLayout>
</PrintLayout>Did this article solve your issue?
Let us know so we can improve!

