La liste de diffusion est fermée depuis juillet 2022, mais sert toujours d'archive d'informations sur QF-Test.
Cependant, si vous souhaitez rester informé des nouveautés concernant QF-Test, vous pouvez simplement vous abonner à la newsletter :
abonner à la newsletter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [QF-Test] Help required working Excel reports in QF-Test version 3.5.5-p1 -- >Jython scripting
Hello Hema, here's an example code based on the more modern Apache POI (which - in contrast to the JXL library - is also able to deal with .xlsx files): from org.apache.poi.hssf.usermodel import HSSFWorkbook from java.io import FileInputStream filename = rc.lookup("qftest", "suite.dir") + "/mytable.xls" fis = FileInputStream(filename) workbook = HSSFWorkbook(fis) fis.close() sheet = workbook.getSheet("Deal Audit"); TValue = 0 col = ord("R") - ord("A") for row in range(9, 20 + 1): cell = sheet.getRow(row - 1).getCell(col) TValue += cell.getNumericCellValue() print TValue Best regards, Robert Am 27.07.2015 15:56, schrieb Hema Nagaraj: Team, Please help me in writing Jython script to find SUM of range of cells in Excel Where testfile is the File name , here I have given dummy path, “Deal Audit” is the sheet name. I have worked earlier on excel for verifying cell data, but finding difficulty in this scenario. *Scenario: Trying to add a range of rows ranging from R9 to R20 in excel and store Total in Variable “TValue”* Below is the script : from jxl import * from java.io import File testFile = "<Path><xls file>" workbook = Workbook.getWorkbook(File(testFile)) sheet = workbook.getSheet("Deal Audit") Rvalue = sheet.range(R9:R20) rc.logMessage(str(RValue), dontcompactify=True, report=True, nowrap=False) TValue = workbook.worksheetfunction.sum(Rvalue) rc.logMessage(str(TValue), dontcompactify=True, report=True, nowrap=False) Thanks, Hema _______________________________________________ qftest-list mailing list qftest-list@?.de http://www.qfs.de/mailman/listinfo/qftest-list
|
1. Cookies fonctionnels
Nous utilisons des cookies fonctionnels pour garantir la fonctionnalité de base du site web.
2. Cookies de performance et de statistique
Nous utilisons Matomo pour analyser et améliorer notre site web. Des cookies permettent une collection anonyme des informations qui nous aident à vous offrir un visite clair et facile à utiliser de nos pages web.
This cookie contains a unique, pseudonymized visitor ID internal to Matomo for recognizing repeat visitors.
This cookie is used to track from which website the anonymized user proceeded to any page or sub-page.
The Matomo session cookie is used to track the visitor's page requests during the session. The cookie is automatically deleted at the end of each session (website visit), at the latest after one day.
is created and should be then directly deleted (used to check whether the visitor’s browser supports cookies).
short lived cookies used to temporarily store data for the visit.
short lived cookies used to temporarily store data for the visit.