SumitM
7 years agoOccasional Contributor
Create CSV file from DataSink (subreport type) using Groovy script
Hi,
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.
Thanks
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.
https://examples.javacodegeeks.com/core-java/writeread-csv-files-in-java-example/
For DataSink type as SubReport, I guess you cannot generate CSV file.