-2

Sorry for being such a newbie as I haven't really tried this before. If this is already answered before, can you please provide the link so I can review it? Here's pretty much what I'd like to accomplish:

enter image description here

I tried to display it in rows in hopes that it will display beside each other such as, Item 1 | Item 2 | Item 3| but it's a no go. I'm pretty much displaying the item list from a Sales Order record or a transaction record into the Advanced PDF layout for the record type.

Thank you if anybody will be able to help. Here's the code block. I'm trying to display the items as the image shows:

<body padding="8mm 13mm 8mm 13mm" size="A4">
<#if record.item?has_content>
<table class="itemTable" width="100%"><!-- start items --><#list record.item 
as item><#if item_index==0>
<thead>
<tr>
<th colspan="6"  class="itemHeader"      align="left" padding-    
bottom="8px">Code</th>
<th colspan="6"  class="itemHeader"  align="left" padding-bottom="8px" 
padding-left="10px">Qty</th>
<th colspan="6"  class="itemHeader"      align="left" padding- 
bottom="8px">Units</th>
<th colspan="18" class="itemHeader"  align="left" padding-bottom="8px" 
padding-left="15px">Product Description</th>
<th colspan="8"  class="itemHeader"  align="left" padding-bottom="8px">Unit 
Price</th>
<th colspan="8"  class="itemHeaderEnd" align="left" padding-bottom="8px" 
padding-left="10px">Amount</th>
</tr>
</thead>
<!-- Print items -->
</#if><tr>
<td colspan="6"  class="itemDetail"     align="left"><@printCode item.item 
/></td>
<td colspan="6"  class="itemDetail"     align="left" padding- 
left="20px">${item.quantity}</td>
<td colspan="6"  class="itemDetail"     align="center">${item.units}</td>
<td colspan="18" class="itemDetail"     align="left" letter-spacing= "0px" 
padding-left="15px" padding-right="50px">${item.description}</td>
<td colspan="8"  class="itemDetail"     align="left"  padding-left="20px"> 
<#if item.rate?is_number>${item.rate?string("#,##0.00")}<#else>${item.rate} 
</#if></td>
<td colspan="8"  class="itemDetailEnd"  align="left"  padding-left="30px"> 
<#if item.amount?is_number>${item.amount?string("#,##0.00")} 
<#else>${item.amount}</#if></td>
</tr>
</#list><!-- end items --></table>
</#if>

I know that the above displays the item with default look from top to bottom, What I would like to achieve is to have it showing from left to right.

Thank you in advance.

-Joe

  • 1
    I don't get why 3 people have downvoted and not left any comments on how to improve for a new user. Anyway, @Joseph: please add the code you're using and the results you're getting so we can try to help. Also, where is this data coming from - are you creating a template to display saved search results, or something else? – Krypton May 21 '18 at 12:43
  • 1
    @Krypton Thank you so much for replying to my question. I've added the detail you were asking and hopefully that I can clear it a little bit. Thank you so much again. – Joseph GelliWelli May 22 '18 at 05:24

1 Answers1

1

The way to do that in BFO is to use a table using the chunk built-in. Then fill the last row with the missing cells.

e.g. ignoring header

<#list record.item?chunk(3) as row>
  <tr>
  <#list row as item>... </#list>
  <#if row?size lt 3 ><td>&nbsp;</td></#if><!-- fill the row -->
  <#if row?size lt 2 ><td>&nbsp;</td></#if>
  </tr>

</#list>
bknights
  • 14,408
  • 2
  • 18
  • 31
  • 1
    Hi there. I'm actually using a table but I just don't know what syntax to use to display the items horizontally instead of the usual vertical format of NetSuite. So for every column, the item name is displayed with all the item details. – Joseph GelliWelli May 22 '18 at 05:26
  • 1
    thanks a lot for your expert suggestion. You just saved me a million thoughts. I guess I'm still new BFO. Do you have a library of BFO codes that I can look at other than what's found in BFO.org? – Joseph GelliWelli Jun 01 '18 at 05:36
  • 1
    Hi @JosephGelliWelli If you found the suggestion useful I think the intent is that you upvote the answer. :-). I don't really have a library of Netsuite specific BFO codes. I've done a bunch of things with them so if you're having trouble figuring something out post some code and I'll probably see it. – bknights Jun 01 '18 at 07:21