how to auto number 2 joined custom table

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
danels
User
Posts: 53

how to auto number 2 joined custom table

Post by danels »

hi.

i have 2 joined table. and i custom display 2 joined table into a table.
it is successfully display the contain of my table but the numbering is wrong. i would like the 2 join table will numbering ascendingly (like 1,2,3,4 and so on). the current result is like (1,1,2,2,3,3,4,4 and so on)

i know i put twice this variable {{{row_cnt}}} so the numbering is repeat twice. but i dont know how and what is the variable

thanks you very much.

here is the source code.

===========================================================

custom template header

<table width="860" border="1" data-rowindex="{{{row_cnt}}}">
<thead>
<tr>

<th width="42" rowspan="2" scope="col" align="center" valign="middle"><b>No</b></th>
<th colspan="9" scope="col" align="center" valign="middle"><b>Dokumen Pemasukan</b></th>
<th colspan="6" scope="col" align="center" valign="middle"><b>Dokumen Pengeluaran</b></th>           
<th colspan="3" scope="col" align="center" valign="middle"><b>Saldo Barang</b></th>             

</tr>
<tr>
<td>
<div class="ewRow">
<span class="ewCell"><b>Tgl PIB</b></td></span>
<span class="ewCell"><b>No PIB</td></span>
<span class="ewCell"><b>Tgl Masuk</td></span>
<span class="ewCell"><b>Kode Barang</td></span>
<span class="ewCell"><b>Pieces</td></span>
<span class="ewCell"><b>Cartons</td></span>
<span class="ewCell"><b>SQM</td></span>
<span class="ewCell"><b>Pecah In Pieces</td></span>
<span class="ewCell"><b>Pecah In SQM</td></span>
<span class="ewCell"><b>Tgl PEB</td></span>
<span class="ewCell"><b>No PEB</td></span>
<span class="ewCell"><b>Kode Barang</td></span>
<span class="ewCell"><b>Pieces</td></span>
<span class="ewCell"><b>Cartons</td></span>
<span class="ewCell"><b>SQM</td></span>
<span class="ewCell"><b>Sisa Pieces</td></span>
<span class="ewCell"><b>Sisa SQM</td></span>
</div>
</td>
</tr>
</thead>
<tbody>

===========================================================================

custom template body


<tr>
<td width="27" align="center" valign="middle">{{{row_cnt}}}</td>
<td width="27" align="center" valign="middle">{{{tgl_pib_600mm}}}</td>
<td width="27" align="center" valign="middle">{{{no_pib_600mm}}}</td>
<td width="27" align="center" valign="middle">{{{tgl_bongkar_600mm_mulai}}}</td>
<td width="27" align="center" valign="middle">{{{uraian_tipe_unfinished_tiles_impor_600mm}}}</td>
<td width="27" align="center" valign="middle">{{{pieces_impor_600mm}}}</td>
<td width="27" align="center" valign="middle">{{{cartons_impor_600mm}}}</td>
<td width="27" align="center" valign="middle">{{{sqm_impor_600mm}}}</td>
<td width="27" align="center" valign="middle">{{{pecah_in_pieces_impor_600mm}}}</td>
<td width="24" align="center" valign="middle">{{{pecah_in_sqm_impor_600mm}}}</td>
<td width="34" align="center" valign="middle">{{{tgl_peb_600mm}}}</td>
<td width="34" align="center" valign="middle">{{{no_peb_600mm}}}</td>
<td width="34" align="center" valign="middle">{{{uraian_tipe_finished_tiles_ekspor_600mm}}}</td>
<td width="34" align="center" valign="middle">{{{pieces_ekspor_600mm}}}</td>
<td width="34" align="center" valign="middle">{{{cartons_ekspor_600mm}}}</td>
<td width="34" align="center" valign="middle">{{{sqm_ekspor_600mm}}}</td>
<td width="10" align="center" valign="middle">{{{sisa_pieces_600mm}}}</td>
<td width="10" align="center" valign="middle">{{{sisa_sqm_600mm}}}</td>
</tr>


<tr>
<td width="27" align="center" valign="middle">{{{row_cnt}}}</td>
<td width="27" align="center" valign="middle">{{{tgl_pib_800mm}}}</td>
<td width="27" align="center" valign="middle">{{{no_pib_800mm}}}</td>
<td width="27" align="center" valign="middle">{{{tgl_bongkar_800mm_mulai}}}</td>
<td width="27" align="center" valign="middle">{{{uraian_tipe_unfinished_tiles_impor_800mm}}}</td>
<td width="27" align="center" valign="middle">{{{pieces_impor_800mm}}}</td>
<td width="27" align="center" valign="middle">{{{cartons_impor_800mm}}}</td>
<td width="27" align="center" valign="middle">{{{sqm_impor_800mm}}}</td>
<td width="27" align="center" valign="middle">{{{pecah_in_pieces_impor_800mm}}}</td>
<td width="24" align="center" valign="middle">{{{pecah_in_sqm_impor_800mm}}}</td>
<td width="34" align="center" valign="middle">{{{tgl_peb_800mm}}}</td>
<td width="34" align="center" valign="middle">{{{no_peb_800mm}}}</td>
<td width="34" align="center" valign="middle">{{{uraian_tipe_finished_tiles_ekspor_800mm}}}</td>
<td width="34" align="center" valign="middle">{{{pieces_ekspor_800mm}}}</td>
<td width="34" align="center" valign="middle">{{{cartons_ekspor_800mm}}}</td>
<td width="34" align="center" valign="middle">{{{sqm_ekspor_800mm}}}</td>
<td width="10" align="center" valign="middle">{{{sisa_pieces_800mm}}}</td>
<td width="10" align="center" valign="middle">{{{sisa_sqm_800mm}}}</td>
</tr>

======================================================================

custom template footer

</tbody>
</table>

================================================================


mobhar
User
Posts: 11736

Post by mobhar »

You don't need to display the following code twice:
<td width="27" align="center" valign="middle">{{{row_cnt}}}</td>

Just remove one of them, or change one of them become the following:
<td width="27" align="center" valign="middle">&nbsp;</td>


danels
User
Posts: 53

Post by danels »

hi again. first of all thanks for your answer. i did try it to remove the either one {{{row_cnt}}} . but the result is "it only numbering the first table" . it doesnt numbering the second table. because we insert the space code only " &nbsp; " .

it doesnt meet what i meant. what i meant is that the joined 2 table will be numbered sequentially.

Please do help. Thanks you very much in advance


mobhar
User
Posts: 11736

Post by mobhar »

Did you mean you want to make the rowspan for the first column which displaying the sequence number?

If so, then change the first occurance code:
<tr>
<td width="27" align="center" valign="middle">{{{row_cnt}}}</td>
<td width="27" align="center" valign="middle">{{{tgl_pib_600mm}}}</td>

become:
<tr>
<td width="27" align="center" valign="middle" rowspan="2">{{{row_cnt}}}</td>
<td width="27" align="center" valign="middle">{{{tgl_pib_600mm}}}</td>

afterwards, change also the second occurance code:
<tr>
<td width="27" align="center" valign="middle">{{{row_cnt}}}</td>
<td width="27" align="center" valign="middle">{{{tgl_pib_800mm}}}</td>

become:
<tr>
<td width="27" align="center" valign="middle">{{{tgl_pib_800mm}}}</td>

Is that what you want?


danels
User
Posts: 53

Post by danels »

Hi again mobhar. first of all thank you very much.
i have tested the code and it combined 2 table into 1 numbering.

what i mean is that 1 table 1 numbering but the tables are mixed.
example

  1. table 1
  2. table 2
  3. table 1
  4. table 2
  5. table 1
  6. table 2

hope this could help to clear what i meant. thanks you very much in advance


mobhar
User
Posts: 11736

Post by mobhar »

Then you cannot make such pattern for that custom code, since the records that belong to your 2 tables are received at once.


Post Reply