Writing Multiple Individual Reports to File

Hello, I'm trying to write a workflow that uses the Reporting functionality to write multiple reports to disk as PDF files. For example, I have 5 different retailers, each with their own sales data stored in one 5-row table, and I want to use the data in those rows to create/write 5 unique reports for each of them. 

Here's what I'm doing right now:

  1. Like the example 09 Enterprise 01 "Generate a report and save the file", I am using one simple workflow to call another local workflow which contains the data table and Data to Report nodes.
  2. The Call Local Workflow returns a binary object (a pdf)
  3. Then I use the Binary Objects to Files node to write it to disk.

It's pretty simple. Almost exactly like that example workflow. The catch is that I need to do this 5 times, once for each store.

I've tried using the Group Loop nodes in different places -- e.g. looping around the Binary Objects to Files node in the master workflow, looping around the Data to Report node in the called workflow, looping around the whole thing. I can even successfully write 5 different files (when looping around the write file node) but the files all contain the same data (for the first store in the table).

Conceptually, I'm not sure how I should think about this. Should I pass in the data from my primary workflow? Should I query all the data from inside the called workflow? Do I need to loop around a filter of some sort? Some combination of all these ideas?

Thanks in advance!

(If it's helpful I can post an example of my workflow, but as I mentioned, it's very similar to that 09 Enterprise 01 example, just with the need to loop 5x)

 

 

 

Hi,

This can be done a lot easier if you have access to a KNIME Server. Is that the case? If not, you can have a look at this example and take it from there: https://www.knime.com/nodeguide/applications/restdemo/call-a-workflow-on-a-server

You have to replace the Call Remote Workflow node with a Call Local Workflow and point it to the workflow creating the report. As you can see in the example, you have to pass the data to the Call Local Workflow in JSON format. You also need to place this inside a loop, starting after the Table to JSON and ending after writing the binary object to disk.

I hope that helps!

Cheers,

Roland