Create CSV file from DataSink (subreport type) using Groovy script
We want to create CSV file using Groovy script from DatSink Subreport data.
DataSInk's subreport has some data as shown below..
Now, we want to create CSV file form this Subreport after testcase execution is done using teardown groovy script. We do not wish to change DataSink report type to something else, i.e Excel or file. We want to use subreport datasink type and export it to CSV.
You can set the DataSink type as "File" and then write value to CSV file. For this, you just need the basic java code for writing data to excel .CSV format using CSVWriter interface.
For DataSink type as SubReport, I guess you cannot generate CSV file.