203 |
203 |
sheet.cell(row = 1, column = col).fill = PatternFill(patternType='solid', fill_type='solid', fgColor=Color('8DB4E2'))
|
204 |
204 |
sheet.cell(row = 1, column = col).border = border
|
205 |
205 |
col += 1
|
206 |
|
'''
|
207 |
|
withoutEmpty = []
|
208 |
|
emptys = []
|
209 |
|
for col in range(len(self.columnOrder[index])):
|
210 |
|
if self.columnOrder[index][col].split(self.delimiterCombine)[0] == self.emptyCol:
|
211 |
|
emptys.append(col)
|
212 |
|
else:
|
213 |
|
withoutEmpty.append(self.columnOrder[index][col])
|
214 |
|
logicalCol = []
|
215 |
|
for header in range(len(withoutEmpty)):
|
216 |
|
target = withoutEmpty[header].split(self.delimiterCombine)[0]
|
217 |
|
for col in range(len(self.columnListAll[index])):
|
218 |
|
if target == self.columnListAll[index][col]:
|
219 |
|
logicalCol.append(table.horizontalHeader().logicalIndex(col))
|
220 |
|
break
|
221 |
|
col = 1
|
222 |
|
emp = 0
|
223 |
|
for header in logicalCol:
|
224 |
|
if header is 0:
|
225 |
|
continue
|
226 |
|
if emp < len(emptys) and col is emptys[emp]:
|
227 |
|
userHeader = self.columnOrder[index][emptys[emp]].split(self.delimiterCombine)[1]
|
228 |
|
sheet.cell(1, col, userHeader)
|
229 |
|
sheet.cell(row = 1, column = col).alignment = Alignment(horizontal='center', vertical='center', wrapText=True)
|
230 |
|
sheet.cell(row = 1, column = col).fill = PatternFill(patternType='solid', fill_type='solid', fgColor=Color('8DB4E2'))
|
231 |
|
sheet.cell(row = 1, column = col).border = border
|
232 |
|
col += 1
|
233 |
|
emp += 1
|
234 |
|
userHeader = table.horizontalHeaderItem(header).text()
|
235 |
|
sheet.cell(1, col, table.horizontalHeaderItem(header).text())
|
236 |
|
sheet.cell(row = 1, column = col).alignment = Alignment(horizontal='center', vertical='center', wrapText=True)
|
237 |
|
sheet.cell(row = 1, column = col).fill = PatternFill(patternType='solid', fill_type='solid', fgColor=Color('8DB4E2'))
|
238 |
|
sheet.cell(row = 1, column = col).border = border
|
239 |
|
col += 1
|
240 |
|
'''
|
241 |
206 |
except Exception as ex:
|
242 |
207 |
from App import App
|
243 |
208 |
from AppDocData import MessageType
|
... | ... | |
250 |
215 |
@brief save excel
|
251 |
216 |
@author kyouho
|
252 |
217 |
@date 2018.08.16
|
|
218 |
@history 2018.10.31 euisung export order apply
|
253 |
219 |
"""
|
254 |
220 |
try:
|
255 |
221 |
thin = Side(border_style='thin', color='000000')
|
... | ... | |
267 |
233 |
target = withoutEmpty[header].split(self.delimiterCombine)[0]
|
268 |
234 |
for col in range(len(self.columnListAll[index])):
|
269 |
235 |
if target == self.columnListAll[index][col]:
|
270 |
|
logicalCol.append(table.horizontalHeader().logicalIndex(col))
|
|
236 |
logicalCol.append(col)
|
271 |
237 |
break
|
272 |
238 |
|
273 |
239 |
exportCol = [0]
|
... | ... | |
411 |
377 |
for table in self.viewTables:
|
412 |
378 |
self.initialTables.append(table.horizontalHeader().saveState())
|
413 |
379 |
|
414 |
|
# config -> list
|
415 |
|
for index in range(len(self.viewTables)):
|
416 |
|
self.columnOrder[index] = docData.getConfigs(dbListOrderName[index], str(index))[0].value.split(self.delimiter)
|
417 |
380 |
self.sortListOrder()
|
418 |
381 |
except Exception as ex:
|
419 |
382 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
|
... | ... | |
437 |
400 |
self.viewTables[index].setColumnCount(len(self.columnListAll[index]))
|
438 |
401 |
self.viewTables[index].setHorizontalHeaderLabels(self.columnListAll[index])
|
439 |
402 |
self.viewTables[index].horizontalHeader().restoreState(self.initialTables[index])
|
440 |
|
#self.columnOrder[index] = docData.getConfigs(dbListOrderName[index], str(index))[0].value.split(self.delimiter)
|
|
403 |
self.columnOrder[index] = docData.getConfigs(dbListOrderName[index], str(index))[0].value.split(self.delimiter)
|
441 |
404 |
withoutEmpty = []
|
442 |
405 |
emptys = []
|
443 |
406 |
emptysUserHeader = []
|
... | ... | |
824 |
787 |
"""
|
825 |
788 |
from ItemDataFormatDialog import QItemDataFormatDialog
|
826 |
789 |
docData = AppDocData.instance()
|
827 |
|
for index in range(len(self.viewTables)):
|
828 |
|
self.columnOrder[index] = docData.getConfigs(dbListOrderName[index], str(index))[0].value.split(self.delimiter)
|
829 |
790 |
|
830 |
791 |
item_data_format_dialog = QItemDataFormatDialog(self, self.columnListAll, self.columnOrder)
|
831 |
792 |
item_data_format_dialog.exec_()
|
832 |
793 |
|
833 |
|
for index in range(len(self.viewTables)):
|
834 |
|
self.columnOrder[index] = docData.getConfigs(dbListOrderName[index], str(index))[0].value.split(self.delimiter)
|
835 |
794 |
self.sortListOrder()
|
836 |
795 |
|
837 |
796 |
'''
|