Description

The ExcelFileMultiSheetReceiver morphs generated data into an Excel formatted file in multiple sheets. The file can be exported in two types: 

  • xlsx
  • xls


Note: Test data generation of Excel files is generally slower than the Delimited (e.g., CSV) file format. 


In This Article


Receiver Parameters

The following parameters can be defined for the ExcelFileMultiSheetReceiver. Items with an asterisk (*) are required. 

  • path* - The location to store the generated output file. 
  • fileName* - The name of the file data will be written to by the Receiver.
  • uniqueAttribute - Defines a Domain Attribute the Receiver will use to identify a unique value that has already been inserted into the file and prevents it.
  • quoteTextData* - Defines the character to use when quoting text data.
  • booleanValue* - Format a Boolean object with the selected mask. 
  • nullValue* - Represens NULL value. 
  • sheetName* - Name of the sheet to write to. If sheetName exists, the data will overwrite; otherwise, a new sheet will be created for the given sheetName.
  • type* - Defines the format in which the file may be saved: xlsx or xls.
  • appendInSheet- Defines whether the appending within the sheet is on or off.



Receiver Attribute Property Keys

The Receiver defines two property keys that can be modified on any of its associated Domain Attributes:

  • columnName - Defines the column name as it will be in the file header.
  • include - Defines if the Attribute will be included as a column in the output file.


Permission Denied Error - Linux Users

During test data generation, a "profiles" folder will be created within a temporary directory to generate the Excel output file. The full path for each operating system is shown below:

  • Linux - /tmp/profiles
  • Windows - /temp/profiles


Linux users may receive the following error during test data generation if they lack folder permissions. Verify access to the /tmp and /profiles folders.


java.lang.RuntimeException:java.io.IOException:Permission denied


Use Case 1 - Generate an Excel File with a Sheet for Each Domain

For this example, five Domains will be used to generate a multi-sheet Excel file. The data generated for each Domain will be an individual sheet within the Excel file.



The following Scenario Chain Set will be used to generate the output data. This Scenario Chain Set will run each Domain Scenario and generate data for all five Domains. Each Domain's loopCount determines the number of records per sheet in this example. "Test" has been entered for the fileName Parameter.



The sheetName Parameter for each Domain's ExcelFileMultiSheetReceiver contains the Domain Name. The User Domain configuration is shown below: 



Sample Output

An Excel file has been created and contains five sheets titled: customer, account, organization, department, and user. The number of records per sheet in this example is determined by each Domain's loopCount.