Apply Custom Format to Item Table for Specific Item Type

Scenario

Formatting rows on the item table based on the item type is currently a limitation in Advanced PDF/HTML Templates and is related to Enhancement : 376525.

Note: To search and vote for the enhancement, see 10054 Voting for Enhancements

You can leverage the HTML language in customizing the Advanced PDF/HTML in order to dynamically update the formatting of the row depending on the item type.

Solution

1. Navigate to Customization Forms Advanced PDF/HTML Templates

2. Preferred Template: Click Edit

3. Look for the line where the item list is printed as shown on the sample below

<table class="itemtable" style="width: 100%; margin-top: 10px;">
<#list record.item as item>
<#if item_index==0>
<thead>
<tr>
<th colspan="4">${‌item.item@label}</th>
</tr>
</thead>
<tr>
<td colspan="4"><span class="itemname">${‌item.description}td>
</tr>
</table>

Copy

4. Apply the sample code below where the item will be partially indented by adding spaces and the text will be bold:
<#if item.amount?string == '' >
<td colspan="4" style="padding-right: 5px;"><span class="itemname"><b>${‌item.description}</b></span></td>
<#else>
<td colspan="4"><span class="itemname">${‌item.description}</td>

Copy

5. Click Save

 

 

Disclaimer: The sample code described herein is provided on an “as is” basis, without warranty of any kind, to the fullest extent permitted by law. Oracle + NetSuite Inc. does not warrant or guarantee the individual success developers may have in implementing the sample code on their development platforms or in using their own Web server configurations.

Oracle + NetSuite Inc. does not warrant, guarantee or make any representations regarding the use, results of use, accuracy, timeliness or completeness of any data or information relating to the sample code. Oracle + NetSuite Inc. disclaims all warranties, express or implied, and in particular, disclaims all warranties of merchantability, fitness for a particular purpose, and warranties related to the code, or any service or software related thereto.

Oracle + NetSuite Inc. shall not be liable for any direct, indirect or consequential damages or costs of any type arising out of any action taken by you or others related to the sample code.

Leave a comment

Your email address will not be published. Required fields are marked *