| 1 |
nino.borges |
662 |
"""
|
| 2 |
|
|
|
| 3 |
|
|
EclipseCatSetReport
|
| 4 |
|
|
|
| 5 |
|
|
Created by
|
| 6 |
|
|
Emanuel Borges
|
| 7 |
|
|
05.01.2018
|
| 8 |
|
|
|
| 9 |
|
|
Creates an excel spreadsheet report from all of the cat sets in this case. Keep in mind that someday the EclipseSQLConnector will be changed to a proper
|
| 10 |
|
|
class, so will need to update this.
|
| 11 |
|
|
|
| 12 |
|
|
"""
|
| 13 |
|
|
|
| 14 |
|
|
import sys
|
| 15 |
|
|
sys.path.append(r"C:\Users\eborges\Dropbox\NinoCode\Active_prgs\Evidox")
|
| 16 |
|
|
|
| 17 |
|
|
import EclipseSQLConnector, ExcelLib
|
| 18 |
|
|
|
| 19 |
|
|
|
| 20 |
|
|
|
| 21 |
|
|
if __name__ == '__main__':
|
| 22 |
|
|
databaseName = 'NYBP-Dairy Farmers Litigation - Review'
|
| 23 |
|
|
|
| 24 |
|
|
## These two lines will def change once EclipseSQLConnector is updated
|
| 25 |
|
|
caseMatrix = EclipseSQLConnector.GetCaseMatrix()
|
| 26 |
|
|
internalCaseName = caseMatrix[databaseName]
|
| 27 |
|
|
|
| 28 |
|
|
catMatrix = EclipseSQLConnector.GetAnalyticsCategorySetsValues(internalCaseName)
|
| 29 |
|
|
|
| 30 |
|
|
#charsNotAllowedList = ['\\','/']
|
| 31 |
|
|
|
| 32 |
|
|
catCategoryList = catMatrix.keys()
|
| 33 |
|
|
catCategoryList.sort()
|
| 34 |
|
|
|
| 35 |
|
|
sheetNumb = 1
|
| 36 |
|
|
xlObj = ExcelLib.ExcelConnection()
|
| 37 |
|
|
xlObj.xlApp.Visible = True
|
| 38 |
|
|
numbOfWorksheets = xlObj.xlBook.Worksheets.Count
|
| 39 |
|
|
numbOfWorkSheetsNeeded = len(catMatrix.keys())
|
| 40 |
|
|
print numbOfWorksheets
|
| 41 |
|
|
print numbOfWorkSheetsNeeded
|
| 42 |
|
|
print (numbOfWorkSheetsNeeded - numbOfWorksheets)
|
| 43 |
|
|
if numbOfWorksheets < numbOfWorkSheetsNeeded:
|
| 44 |
|
|
for i in range ((numbOfWorkSheetsNeeded - numbOfWorksheets) + 1):
|
| 45 |
|
|
xlObj.xlBook.Worksheets.Add()
|
| 46 |
|
|
|
| 47 |
|
|
for catCategory in catCategoryList:
|
| 48 |
|
|
print "now creating %s"%catCategory
|
| 49 |
|
|
tabName = catCategory
|
| 50 |
|
|
tabName = tabName.replace('\\','')
|
| 51 |
|
|
tabName = tabName.replace('/','')
|
| 52 |
|
|
#tabName = tabName.replace("-","")
|
| 53 |
|
|
xlObj.setCell(sheetNumb, 2,3, 'Reference Document')
|
| 54 |
|
|
xlObj.setCell(sheetNumb, 2,4, 'Excerpt Text or Full Document')
|
| 55 |
|
|
xlObj.setRange(sheetNumb,3,3,catMatrix[catCategory], tabName)
|
| 56 |
|
|
sheetNumb = sheetNumb + 1
|
| 57 |
|
|
|