In OpenOffice Writer, how is it possible to remove a blockTable when a loop filter is empty.
In my sales quotation report, I have the following loop code that is meant to return all sale order lines that contain the word "sample":
repeatIn(filter(lambda x: "sample" in x.product_id.categ_id.complete_name,so.order_line),'o')
This works fine and with the addition of a formula o.name, it prints out all the requested lines.
I have put this code within a single table cell.
It works for as long as the condition is true, but if I have a sale order with absolutely no sample in any of the lines, then I get an error message saying the table cannot be empty.
So how is it possible to remove that table altogether, using the removeParentNode("blockTable") somewhere?
Try the following line:
[[ filter(lambda x: "sample" in x.product_id.categ_id.complete_name,so.order_line) or removeParentNode("BlockTable") ]]
If you put the line right after the starting
<blockTable> tag, then the "browse(.." should not be displayed. I always edit the RML manually so I do not know whether this is possible in OpenOffice.
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
|Asked: 3/6/13, 3:46 AM|
|Seen: 2083 times|
|Last updated: 3/16/15, 8:10 AM|