0

OpenERP Employee Payslip RML Report を変更しています。収益または控除で行を分割したいと考えています。これが最終結果として私が期待するものです:

 _____________________________ _____________________________
| Earnings                    | Deductions                  |
|                             |                             |
| Description        Amount   | Description        Amount   |
| BASIC               7000.00 | Provident Fund      300.0   |
| House Rent           500.00 | Professional Tax    200.0   |                    
| Conveyance           200.00 |                             |
| Other Allowance      300.00 |                             |
|_____________________________|_____________________________|

しかし、これは、控除額と収益額の長さが同じでない場合に得られるものです。

 _____________________________ _____________________________
| Earnings                    | Deductions                  |
|                             |                             |
| Description        Amount   |                             |
| BASIC               7000.00 |                             |
| House Rent           500.00 | Description        Amount   |
| Conveyance           200.00 | Provident Fund      300.0   |
| Other Allowance      300.00 | Professional Tax   200.0    |
|_____________________________|_____________________________|

これは私の RML です:

<blockTable colWidths="270, 270">
  <tr>
    <td><para style="P15">Earnings</para></td>
    <td><para style="P15">Deductions</para></td>
  </tr>
  <tr>
    <td>
      <blockTable colWidths="200.0, 70.0">
        <tr>
          <td>Description</td>
          <td>Amount</td>
        </tr>
      </blockTable>
      <section>
        <blockTable colWidths="200.0, 70.0">
          <para style="P4">[[repeatIn(get_payslip_lines(o.line_ids, 'earnings'),'p') ]]</para>
          <tr>
            <td>[[ p['name'] ]]</td>
            <td>[[ p['amount'] ]]</td>
          </tr>
        </blockTable>
      </section>
    </td>
    <td>
      <blockTable colWidths="200.0, 70.0">
        <tr>
          <td>Description</td>
          <td>Amount</td>
        </tr>
      </blockTable>
      <section>
        <para style="P4">[[repeatIn(get_payslip_lines(o.line_ids, 'deductions'),'d') ]]</para>
        <blockTable colWidths="200.0, 70.0">
          <tr>
            <td>[[ d['name'] ]]</td>
            <td>[[ abs(d['amount']) ]]</td>
          </tr>
        </blockTable>
      </section>
    </td>
  </tr>
</blockTable>

正しいマークアップについて教えてください。

4

1 に答える 1

2

必要なのは、表のセルの垂直方向の配置を設定することです。この目的のために <blockTableStyle> を使用する必要があります。

<stylesheet>    
    <blockTableStyle id="T1">
        <blockValign value="TOP"/>
    </blockTableStyle>
<stylesheet>    

その後、テーブル定義で:

<blockTable colWidths="270, 270"  style="T1">
    <tr>
        <td><para style="P15">Earnings</para></td>
        <td><para style="P15">Deductions</para></td>
    </tr>
    <tr>
        <td>
            <blockTable colWidths="200.0, 70.0">
                <tr>
                    <td>Description</td>
                    <td>Amount</td>
                </tr>
            </blockTable>
            <section>
                <blockTable colWidths="200.0, 70.0">
                    <para style="P4">[[repeatIn(get_payslip_lines(o.line_ids, 'earnings'),'p') ]]</para>
                    <tr>
                        <td>[[ p['name'] ]]</td>
                        <td>[[ p['amount'] ]]</td>
                    </tr>
                </blockTable>
            </section>
        </td>
...
于 2013-11-24T01:43:18.490 に答える