Forum Discussion
roja1
Contributor
Hi HimanshuTayal ,
Thanks for your reply. I'm not saving my response manually. We need to do this through the groovy script
HimanshuTayal
4 years agoCommunity Hero
roja1 ,
What i mean was not to store request and response directly into Excel Sheet cell,
Store your request and response into txt file and in excel cell write the link of the txt file:
def extRequest = context.rawrequest;
def requestFile = "REQUEST File Path";
def extResponse = context.response;
def responseFile = "RESPONSE File Path";
//Storing Request
def rqfile = new File(requestFile);
rqfile.write(extRequest, "UTF-8");
//Storing Response
def rsfile = new File(responseFile);
rsfile.write(extResponse, "UTF-8");
By below command you can add hyperlink in your desired excel cell:
//Styling for hyperlink cell
CellStyle hlink_style = workbook.createCellStyle();
Font hlink_font = workbook.createFont();
hlink_font.setUnderline(Font.U_SINGLE);
hlink_font.setColor(Font.COLOR_RED);
hlink_style.setFont(hlink_font);
//adding hyperlink
Hyperlink link = createHelper.createHyperlink(Hyperlink.LINK_FILE);
Cell cell = null;
cell=row.createCell((short) 1);
cell.setCellValue("Go to Result");
path_f="TXT FILE PATH";
link.setAddress(path_f);
cell.setHyperlink(link);
Related Content
- 6 months agosohailalam2696
- 5 years agoNed
Recent Discussions
- 20 hours agoGuhan-B
- 5 days agoruchisingh