Displaying Subform records in HTML View

Displaying Subform records in HTML View

I am trying to display all the subform records that are submitted on the within a single entry of the parent form in a HTML view. 

My code is below, I cannot seem to get the loop right. It is only showing a single entry on the HTML page.

  1. htmlpage Call_in_Report_HTML(ID, Id1)
  2. displayname = "Call_In_Report_HTML"
  3. print = true
  4. pdf = true
  5. content
  6. <%{%>

  7. <div style="width:95%; margin:0 auto;">
  8. <%a  =  Call_in_report_new  [ID == input.Id1.toLong()];
  9.     for each a in Call_in_report_new  [ID == input.Id1.toLong()]
  10.     {%>

  11. <h1 style="margin:0px; padding:0px; text-indent:10px; border-bottom:1px solid #000; padding-bottom:5px; text-transform: uppercase">Call in Report Date: <%=a.Todays_Date%></h1>

  12.     <table border="1" width="100%" cellspacing="0" cellpadding="5"> 
  13.     <tr>
  14.     <td width="55%" style="background-color:#ccc;"><strong>Truck:</strong></td>
  15.     <td width="45%" style="background-color:#ccc;"><%=a.details.Truck%></td>
  16.   </tr>
  17.     <tr>
  18.     <td style="background-color:#eee;" ><strong>On Schedule:</strong></td>
  19.     <td ><%=a.details.On_Schedule%></td>
  20.   </tr>
  21.     <tr>
  22.     <td style="background-color:#eee;" ><strong>Departure:</strong></td>
  23.     <td ><%=a.details.Departure%></td>
  24.   </tr>
  25.     <tr>
  26.     <td style="background-color:#eee;"><strong>Carrier</strong></td>
  27.     <td><%=a.details.Carrier%></td>
  28.   </tr>
  29.   <tr>
  30.     <td style="background-color:#eee;" ><strong>Call in Location</strong></td>
  31.     <td><%=a.details.Location%></td>
  32.   </tr>
  33.     <tr>
  34.     <td style="background-color:#eee;"><strong>Mush Pallets Shipped</strong></td>
  35.     <td><%=a.details.Mush_Pallets%></td>
  36.   </tr>
  37.   <tr>
  38.     <td style="background-color:#eee;"><strong>Freight Pallets Shipped</strong></td>
  39.     <td><%=a.details.Freight_Pallets%></td>
  40.   </tr>

  41.   <tr>
  42.     <td style="background-color:#eee;"><strong>Total Pallets Shipped</strong></td>
  43.     <td><%=a.details.Total_Pallets%></td>
  44.   </tr>

  45.   <tr>
  46.     <td style="background-color:#eee;"><strong>Comments:</strong></td>
  47.     <td><%=a.details.Comments%></td>
  48.   </tr>
  49. </table>
  50.     <%}
  51. }%>