Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

2

Hello Monisha,

If you want to generate a tabular structure in you rml report you can use <blockTable> .. </blockTable> tag, so you can compare this with the html <Table>..</Table> tag. But the thing is while creating the <blockTable> you need to specify how many columns would be there under it using "colWidths" attribute. See example

<blockTable colWidths="50.0,40.0,25.0">

   <tr><td>....</td></tr>

</blockTable>

This width values depends upon the width specified for your rml report under the <frame> tag, so generally you have to distribute your columns width accordingly, whatever no of columns you have. If there is a mismatch in specifying no of colWidths and columns designed under <blockTable> then system will throw and error as "Attribute Erro".

Also there is another attribute like "colWidths", that is "style" where you can specify which style will be applied to the specific <blockTable>. See Example

<blockTable colWidths="55.0" style="tbl_labels">

<tr><td>...</td></tr>

</blockTable>

So here you can see that style name "tbl_labels" is been applied to this blockTable. Now this style is to be defined above the <blockTable> under <stylesheet> .. </stylesheet> tag where you will have to define the tag <paraStyle>. See Example

<stylesheet>

<paraStyle name="tbl_labels" fontName="Courier" fontSize="12.0" leading="15" alignment="CENTER"/>

</stylesheet>

So, by defining style you can set the text alignment, text-colour, leading space, spacebefore and spaceafter blocktable ,font name, font size.

Under the blocktable you can iterate the loop using <section>.. </section> and <repeatIn> tag.

Regards

Good answer. Additional Information can be found in the RML User Guide: http://www.reportlab.com/docs/rml2pdf-userguide.pdf

René Schuster
on 7/7/14, 5:15 AM

Thank you @Rene Schuster

Hiren Vora - CEO at Emipro Technologies Pvt. Ltd. India
on 7/7/14, 6:03 AM
0
Manoj
On 7/7/14, 3:16 AM

Hi Monisha
<blockTable> -->  Its a simple tag which indicates that now you are going create a table like structure i.e. you are going to work with a table. Simply it is the starting point tag to workwith table in or creating tables in rml. This is similar to <table> tag in html, if you are familiar with basic html. We can write as many as desire <tr> and <td> tags between the <blockTable> </blockTable>.where <tr>creates rows and we keep <td> inside <tr> </tr> to create columns. All tags should be closed propely</ ...>.

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/6/14, 11:53 PM
Seen: 2317 times
Last updated: 3/16/15, 8:10 AM