# Report help needed

**URL:** <https://discuss.tryton.org/t/report-help-needed/1696>\
**Category:** Developer\
**Created:** [August 28, 2019, 10:30am UTC](https://discuss.tryton.org/t/report-help-needed/1696 "2019-08-28T10:30:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kakamble](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/kakamble/32/494_2.png) [@kakamble](https://discuss.tryton.org/u/kakamble)\
**Post date:** [August 28, 2019, 10:30am UTC](https://discuss.tryton.org/t/report-help-needed/1696/1 "2019-08-28T10:30:07Z")

</div>

I am currently creating a report. The following is a screenshot of a part of that report

 ![Screenshot%20from%202019-08-28%2015-41-01](https://discuss-cdn.tryton.org/uploads/default/original/1X/dfef0f11d06e9d8651d19d5a4f2c1c109e9c72ae.png)

When I run the server and print the report, it gives the data like this

 ![final%20printed%20report](https://discuss-cdn.tryton.org/uploads/default/original/1X/aed7cf52afca2c5b60eb55f560ed8d7773c61236.png)

I do not want extra blanks rows to appear but I want to keep the table format **as it is** (I do not want to place deductions below pay and allowances). I tried defining two lists as the follows:

```
@property
def pay_and_allowances(self):
    allowances_lines = []
    if self.lines:
        for line in self.lines:
            if line.category.code in ['BASIC', 'ALW']:
                allowances_lines.append(line)
    return allowances_lines

```

and

```
@property
def deductions(self):
    deductions_lines = []
    if self.lines:
        for line in self.lines:
            if line.category.code in ['DED']:
                deductions_lines.append(line)
    return deductions_lines

```

and applying them side by side in two separate for loops. But on trying to print the report, it gives me error about matching tags.

Please tell me whether there is a way to make this possible.

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [August 28, 2019, 10:42am UTC](https://discuss.tryton.org/t/report-help-needed/1696/2 "2019-08-28T10:42:46Z")

</div>

> [@kakamble](#):
>
> But on trying to print the report, it gives me error about matching tags.

That’s probably because you did not close correctly som for loop or other tags.

I can not see any other error in the code you posted. Reports support the usage of python properties.

---

<div class="post-metadata">

**Author:** ![kakamble](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/kakamble/32/494_2.png) [@kakamble](https://discuss.tryton.org/u/kakamble)\
**Post date:** [August 28, 2019, 10:55am UTC](https://discuss.tryton.org/t/report-help-needed/1696/3 "2019-08-28T10:55:07Z")

</div>

I was trying to use something like this

 ![i_was_trying_to_use_something_like_this](https://discuss-cdn.tryton.org/uploads/default/original/1X/71b1d3af3a42d10674a0952dd734a95023972c24.png)

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [August 28, 2019, 10:58am UTC](https://discuss.tryton.org/t/report-help-needed/1696/4 "2019-08-28T10:58:07Z")

</div>

You can not have two loops mixed inside the same table.  
You must use two tables or make a unique loop on both list using [zip](https://docs.python.org/3.5/library/functions.html#zip).

---

<div class="post-metadata">

**Author:** ![kakamble](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/kakamble/32/494_2.png) [@kakamble](https://discuss.tryton.org/u/kakamble)\
**Post date:** [August 28, 2019, 11:02am UTC](https://discuss.tryton.org/t/report-help-needed/1696/5 "2019-08-28T11:02:07Z")

</div>

But using zip would truncate some values required in the table. Will try using zip\_longest if possible.
