[YARG] Generate multiple worksheets based on a report band?

I would like to create a YARG report that will output the outermost band on individual worksheets in an Excel workbook. For example, if I have a band with data:


I would like to create an output Excel workbook that contains three tabs labeled “A”, “B” and “C”. The data defined in sub-bands would appear on the appropriate tab.

Is it possible?

1 Like


With XLSX report I have tried the following:

  1. In the parent Band, I have specified a query which returns a list of entity IDs.
  2. I have created three child bands. Each of them has a query with parameter - entity Id from the parent band.
  3. In the template, for those child bands, I have created named regions on separate worksheets.

As result, the generated report has several worksheets and data from each band is printed on a separate worksheet. It works well with a list of entities.

1 Like

Sorry for the delay in responding. Unfortunately, I don’t know how many worksheets I need. As a generic example (not the real application), consider a set of customer ledgers in an accounting package. I want to create one worksheet inside the workbook for each customer, showing their debits and credits. The name of the worksheet (appearing in the tab) would be the customer name.

Since the number of customers in this situation is variable, pre-allocating worksheet tabs and splitting them manually as you have in your example won’t work.

What would be perfect is a way to tell YARG that the spreadsheet template I am providing should be “stamped” on multiple worksheets, one for each entity returned in a band. So, it would be a band setting. Along with it would be the field to be used for the worksheet name.

Is this possible?


Now there is no simple way to generate such report. But we are going to implement it some day. I have linked the ticket. See the link on the right.

If you use reporting in a CUBA project, instead of printing all the customers in one report you can print multiple reports for a list of entities. Please see the documentation: https://doc.cuba-platform.com/reporting-6.4/run_actions.html

Add TablePrintFormAction on your “Customer browse-screen”. Then enable multi-selection in the entity table.

When multiple instances are selected in the table and TablePrintFormAction is launched, set of files is generated and they are downloaded packed to a zip archive.

So my users would have to select entities. That might work in some cases.

Is it also possible to put up a parameter form, execute a query to find the entities that fit the parameters, then pass that list to a report? Would that also generate a zip archive?

If this is possible, is there an example somewhere?

:ticket: See the following issue in our bug tracker: