2011-02-15 27 views

Respuesta

3

La forma normal de ReportLab para hacer esto sería utilizar en su lugar Platypus y el Table flowable. Cuando establece el estilo del Table, puede especificar un comando 'SPAN' que agrupará cualquier área rectangular de celdas en una sola. Encontrará más información al respecto en ReportLab User Guide, capítulo 7, página 81.

Si debe usar RML, me inclino a pensar que colspan simplemente no está disponible. Al menos no está en el ReportLab RML reference document. En cambio, creo que se supone que debes usar los elementos blockSpan. No hay ningún ejemplo, pero lo encontrará en the RML manual.

+0

No es así como látigo solución como Don Kirkby mencionó –

8

La sugerencia de Gordon del elemento blockSpan funcionó para mí. Aquí está un ejemplo de cómo se usa: guía

<?xml version="1.0"?> 
<document filename="test.pdf"> 
    <template pageSize="(612,792)" title="Test" author="Don Kirkby"> 
    <pageTemplate id="first"> 
     <frame id="first" x1="10.0" y1="10.0" width="592" height="772"/> 
    </pageTemplate> 
    </template> 
    <stylesheet> 
    <blockTableStyle id="main"> 
     <blockSpan start="0,1" stop="1,1"/> 
    </blockTableStyle> 
    </stylesheet> 
    <images/> 
    <story> 
    <blockTable colWidths="100.0,287.5,187.5" style="main"> 
     <tr> 
     <td><para>Cell 0,0</para></td> 
     <td><para>Cell 1,0</para></td> 
     <td><para>Cell 2,0</para></td> 
     </tr> 
     <tr> 
     <td><para>Cell 0,1 will flow into its neighbour</para></td> 
     <td><para>Cell 1,1 will not appear, but must be present</para></td> 
     <td><para>Cell 2,1</para></td> 
     </tr> 
     <tr> 
     <td><para>Cell 0,2</para></td> 
     <td><para>Cell 1,2</para></td> 
     <td><para>Cell 2,2</para></td> 
     </tr> 
    </blockTable> 
    </story> 
</document> 
+0

solución más útil, necesita entender Combinar las dos primeras columnas, fusionar la última cruda con el puño y la segunda columna. –

Cuestiones relacionadas