Do not display table if there is no returned data in the rows

Hello,

I have the following DOC template( you can find it attached) and I have a few tables in it.
Is there any way NOT to display the table at all, for example table - “№3” from the attached document, if there is nothing returned from band “graduate”? So if we have no data returned for band “graduate”, the downloaded DOC file would not contain table “№3”.

Thank you in advance for all your effort. tableDisplay.docx (25.3 KB)

Hi,

Reporting module has an abstraction Control table that is used to hide the table. Control table contains a nested table with data. Control table has specified band name. Control table and nested table are not shown in the result document if the band for control table is empty. See sample DOCX template control-tables-1.docx (10.3 KB).

Thanks,
Subbotin Andrey

Hi Andrey,

Thank you very much for your answer. However when I tried your suggestion it didn’t work. I’ve used your template and created two absolutely empty bands(with no dataset in them) in my report: “Control1” and “Band1”. After I downloaded the report, the nested table was still visible in it.

testEmptyBands
Индивидуален отчет-386.docx (10.7 KB)

Do we have to set some more options or the abstraction band “Control1” should contain something specific?

Thank you in advance for your answer.

Best regards,
Dimitar

Hi Dimitar,

A sample report is in attachments ControlTable.zip (11.1 KB). Also set property reporting.putEmptyRowIfNoDataSelected to false in a database properties (or using Administration → Application Properties).

Now, control tables can’t work correctly with reporting.putEmptyRowIfNoDataSelected = true flag. We plan to fix it in the feature. YouTrack issue https://youtrack.cuba-platform.com/issue/PL-9925

Thanks,
Andrey Subbotin

Hi Andrey,

Thank you very much, this way it works.

But could we have more than one control band? Now if I have a second control band with name “Control2”, the nested table will display the right number of rows, but they stay empty with no data in them. If I change the name to “Control” will work correctly, but this way I could have only one control band.

Could you please let me know your toughs on this?
Thank you very much.

Hi Dimitar,

Try to set names for control bands with following rules: name should end with Control, e.g. Band1Control, Band2Control.

Thanks.

Hi Andrey,

I tried it and it working fine :slight_smile:

Thank you for all the effort and support,

Hello,

I tried to download the examples, but I can’t. Can you explain to me how to add controls in the template and in CUBA? Please.