Please wait...

Creating bulk XLSX files in WP Report Builder

Example of a Bulk XLSX Report with Multiple FilesBulk XLSX example

Please note that Bulk XLSX generation is a time and hardware consuming operation and works significantly slower than bulk DOCX report generation – e.g. 6-7 minutes for bulk generation of 100 files. We suggest using bulk DOCX whenever possible to avoid delays (on some hosts script execution timeouts are possible).

Report Builder for wpDataTables can be used to create multiple Excel XLSX files with actual data in one click. If you provided a data source wpDataTable, Report Builder will create a separate Excel file for each row, and fill it in with the cell values as you provide, then compress in a ZIP and send back to you.

See this example. Sort, filter, or switch pages in the table, and try to download the ZIP file to see how it adjusts to the table.

wdt_ID Client Manager Name Manager Phone Business Type Account Number
1 Xanthus Wong Lisandra Carey (03927) 4533823 Programming 201-466329507-131
2 Ali Gould Damian Martin (032613) 418327 Planning 214-988824748-758
3 Isaac Riley Leilani Sandoval (06266) 4319834 Engineering 201-486183627-601
4 Xenos Burch Rosalyn Vincent (0135) 55876693 Engineering 201-420453148-998
5 Michael Moss Tucker Murray (016) 80222165 Consulting 214-999563484-497
6 Samuel Knox Ingrid Gomez (0591) 41380580 Engineering 214-913702698-420
7 Eaton Christian Nehru Washington (061) 28432972 Planning 214-931646214-625
8 Brittany Woods Graiden Brown (09502) 2056796 Programming 214-938358045-543
9 Alika Savage George Lawrence (0797) 41443062 Insurance 214-919570900-020
10 Alden Stokes Genevieve Mendez (07428) 5716055 Engineering 214-990688506-173
wdt_ID Client Manager Name Manager Phone Business Type Account Number

Bulk XLSX Generator for WordPressBulk XLSX generation process

Now, let’s see a step-by-step walkthrough on creating such a report in WP Report Builder for wpDataTables.

1. Prepare a wpDataTable with data.

Because WP Report Builder has integration with wpDataTables, it can be generated only based on a wpDataTable. So the first step for creating a bulk XLSX report is to prepare a wpDataTable.

In this case we built a wpDataTable with Table Constructor tool (imported from CSV). It had the following columns: “Client”, “Manager Name”, “Manager Phone”, “Business Type”, “Account Number”.

You can read more about creating tables in Table Constructor here.

2. Prepare the Excel XLSX template file.

Next step is to prepare the Excel file that will be filled with data. We used these variables for this specific report:

  • Predefined variables: ${generatorname} (name of the user that generated the report)
  • Additional variables: ${additionalnotes} (the “additional notes” field that can be changed from front-end)
  • Cell values from wpDataTable: ${client}, ${businesstype}, ${managername}, ${managerphone}, ${accountnumber}

Please do not forget that in Excel reports for variables to be recognised correctly they should be placed in separate cells.

See the full list of rules on preparing templates for Report Builder here.

3. Create the report in your WP-admin using the Report Builder Wizard.

Go to WP-admin, open ReportBuilder -> Create a new report

On the first step choose the source wpDataTable:

Client database table

On the next step provide the report name, choose ‘Multiple file’ generation logic (which means we’ll create a separate file for each row), tick “Follow table filtering”, set the generated filename mask as “${client}-welcome” and define one additional variable – “additionalnotes” with some default value:

Client settings

Then upload the template that you have prepared (click “Browse…“, drag&drop the file, click “Use template”):

Choose template

On the next step you can download the preview for X first rows of the table:

Download preview button

If you are satisfied, you can click “Save Report” to store the result, if something is wrong, you can go back in the wizard and change the settings or upload a different template. Once you click “Save Report”, you will see the shortcodes for this report:

Clients shortcodes

The shortcodes contain buttons for downloading report, saving report to WP Media Library, and for inputs for additional variables.

You can copy these shortcodes directly from this page by clicking on shortcode button, but this isn’t necessary as you can always generate these in standard WordPress post/page editor, or in Visual composer.

Once you close the wizard you will be redirected to the Browse page. You can always quickly download the report (for the whole table) from there by clicking the “Download” button, or quickly get the list of available shortcodes.

The last thing to do is to insert the Report controls to the post or page where you need them, so the users would be able to use it:

  • See here how to insert the report builder controls to the post or page using standard WordPress Visual editor.
  • See here how to insert the report builder controls to the post or page using Visual Composer.