Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

how to create Excel files from Data extracted from tests

Options
hpatel
hpatel Posts: 16

My use case is generate excel file from data extracted from tests like DB Tool or Extension tool. Can someone help?

Tagged:

Comments

  • OmarR
    OmarR Posts: 234 admin
    edited May 2017
    Options

    After extracting the data to a csv file, I believe simply changing the extension from .csv to .xls or .xlsx could suffice. You could follow the steps provided in this post and then write a short script to rename/reformat the .csv file to your desired excel format.

  • hpatel
    hpatel Posts: 16
    Options

    Thanks much Omar, but my biggest worry is CSV only carry value separated by Comma where as my excel file do have color coding and certain format which allows in excel not CSV, how to handle that?

  • hpatel
    hpatel Posts: 16
    Options

    Omar if you mean to rename the file like ren "filename.csv" "filename.xls" it's not converting into right format of Excel and showing below message... if you can explain in details would be great.

  • jakubiak
    jakubiak Posts: 798 admin
    Options

    If you want to automatically generate an Excel file which has specific formatting, simply converting from CSV to Excel will not support that. You would need to write your own code using some library like Apache POI to generate the Excel file with the behavior that you desire.

  • hpatel
    hpatel Posts: 16
    edited May 2017
    Options

    @jakubiak thanks much for input, could you help if you have done this (generating Excel) through sample code in jython/java/javascript or any other support by SOATest?

  • jakubiak
    jakubiak Posts: 798 admin
    Options

    Unfortunately I don't have a specific example I have written that I can show you - but you can take a look here: https://poi.apache.org/spreadsheet/how-to.html

  • hpatel
    hpatel Posts: 16
    Options

    again, thanks much @jakubiak

Tagged