ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/Evidox/EclipseCatSetReport.py
Revision: 746
Committed: Thu Apr 15 20:11:16 2021 UTC (4 years, 11 months ago) by nino.borges
Content type: text/x-python
File size: 1877 byte(s)
Log Message:
Updated to be compatible with python3, which made the bak files.

File Contents

# User Rev Content
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 nino.borges 746 catCategoryList = list(catMatrix.keys())
33 nino.borges 662 catCategoryList.sort()
34    
35     sheetNumb = 1
36     xlObj = ExcelLib.ExcelConnection()
37     xlObj.xlApp.Visible = True
38     numbOfWorksheets = xlObj.xlBook.Worksheets.Count
39 nino.borges 746 numbOfWorkSheetsNeeded = len(list(catMatrix.keys()))
40     print(numbOfWorksheets)
41     print(numbOfWorkSheetsNeeded)
42     print((numbOfWorkSheetsNeeded - numbOfWorksheets))
43 nino.borges 662 if numbOfWorksheets < numbOfWorkSheetsNeeded:
44     for i in range ((numbOfWorkSheetsNeeded - numbOfWorksheets) + 1):
45     xlObj.xlBook.Worksheets.Add()
46    
47     for catCategory in catCategoryList:
48 nino.borges 746 print("now creating %s"%catCategory)
49 nino.borges 662 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