Excel Exporter - Errors when running an export

3
Hi, I realise that this question has been asked before but there does not seem to have been an answer that helps me. I'm running the excel exporter module and cannot get an export to work. The problem lies with the input object. Is this meant to be the entity that you want to get your data from or, as hinted at in the incomplete how to, a specialisation of the FileDocument associated with the entity you want to export from? It seems that no matter what combination I use I end up with either a 'cannot create excel, because the input object isn't given' or no error and no download file even though the GenerateExcelDoc java returns a FileDocument object. Would someone who has this working be able to explain: Is the input object the base/main entity that you want to export from? How is the row object different from the input object? Can these be the same? It would be great to get a definitive answer on this as it looks like quite a few people are stuck on this also. Thanks in advance, Trevor
asked
1 answers
7

Trevor,

The error that you are seeing is caused by the inputobject being empty in the java action mapping.

Below is an explanation of how to work with the excel exporter with a simple example.

The input object is an entity that you create and associate the data you want to export to. Let's say you have an entity Person containing persons with a couple of attributes describing the person. The second entity you have is an Organisation. Every person record has an association to 1 organisation. If you want to export all the persons for a specific organisation your template input object is the organisation entity. In the next steps (the sheet) you define the row object as the Person entity, with the reference to the input object the association between person and organisation. Then define the column data, the attributes of the Person entity. Now your template is ready.

The from the useme folder in the modeler copy the GenerateReport microflow and make sure that:

  1. The input parameter for the microflow is the organisation
  2. Create an action before the java call to retrieve the template just created
  3. After this task create a new System.FileDocument
  4. Update the mapping in the java action call to include the input parameter as the InputObject, the OutputDocument as the NewFileDocument and the TemplateObject as the template retrieved
  5. Add a button to your Organisation_Overview page that connects to the microflow just created
  6. Deploy, select an organisation in the grid and press the button and you have a xls(or csv) export of the persons belonging to the selected organisation

This is just an example, but you can of course create the input object in a microflow, retrieve the export values you need and associate them to the new input object (matching what you setup in the template), retrieve the template, create the filedocument and call the java action and download to create any kind of xls/csv export.

Hope this helps in understanding how to work with the excel exporter.

answered