LeenO computo metrico con LibreOffice  3.22.0
Il software libero per la gestione di computi metrici e contabilità lavori.
SheetUtils.py
Vai alla documentazione di questo file.
1 '''
2 Utilities to handle worksheets
3 
4 Copyright 2020 by Massimo Del Fedele
5 '''
6 import random
7 import uno
8 from com.sun.star.xml import AttributeData
9 from com.sun.star.beans import PropertyValue
10 from com.sun.star.util import SortField
11 import LeenoUtils
12 import LeenoSettings
13 import DocUtils
14 import LeenoDialogs as DLG
15 
16 from datetime import date
17 
18 '''
19 User defined attributes handling in worksheets
20 Not supporting (by now) namespaces, it allows to
21 insert strings attributes into spreadsheets
22 '''
23 
24 def setSheetUserDefinedAttribute(oSheet, name, value):
25  userAttributes = oSheet.UserDefinedAttributes
26  attr = AttributeData()
27  attr.Type = "CDATA"
28  attr.Value = value
29  if userAttributes.hasByName(name):
30  userAttributes.replaceByName(name, attr)
31  else:
32  userAttributes.insertByName(name, attr)
33  oSheet.UserDefinedAttributes = userAttributes
34 
35 def getSheetUserDefinedAttribute(oSheet, name):
36  userAttributes = oSheet.UserDefinedAttributes
37  if userAttributes.hasByName(name):
38  return userAttributes.getByName(name).Value
39  return None
40 
41 def hasSheetUserDefinedAttribute(oSheet, name):
42  userAttributes = oSheet.UserDefinedAttributes
43  return userAttributes.hasByName(name)
44 
46  userAttributes = oSheet.UserDefinedAttributes
47  if userAttributes.hasByName(name):
48  userAttributes.removeByName(name)
49  oSheet.UserDefinedAttributes = userAttributes
50 
51 
52 # ###############################################################
53 
54 
55 def replaceText(sheet, replaceDict):
56  '''
57  in un foglio cerca tutte le occorrenze delle chiavi
58  contenute in 'replaceDict' e le sostituisce con i rispettivi valori
59  '''
60  replace = sheet.createReplaceDescriptor()
61  for key, val in replaceDict.items():
62  replace.SearchString = key
63  if type(val) == date:
64  # for date use a nice format....
65  val = LeenoUtils.date2String(val, 0)
66  else:
67  # be sure 'val' is a string...
68  val = str(val)
69  replace.ReplaceString = val
70  sheet.replaceAll(replace)
71 
72 
73 # ###############################################################
74 
75 
77  '''
78  given a sheet object returns containing document
79  sadly there's no built-in interface for it
80  and there's no simple way to do it...
81  '''
82  # get all documents from desktop
83  attrName = str(random.random())
84  setSheetUserDefinedAttribute(oSheet, attrName, "JUSTSOMETHING")
85 
86  oEnum = LeenoUtils.getDesktop().Components.createEnumeration()
87  while oEnum.hasMoreElements():
88  oDoc = oEnum.nextElement()
89  try:
90  sheets = oDoc.Sheets
91  idx = 0
92  while idx < sheets.Count:
93  sheet = sheets[idx]
94  if getSheetUserDefinedAttribute(sheet, attrName) == "JUSTSOMETHING":
95  # found, return it
96  removeSheetUserDefinedAttribute(oSheet, attrName)
97  return oDoc
98  idx += 1
99  except Exception:
100  pass
101  # not found
102  removeSheetUserDefinedAttribute(oSheet, attrName)
103  return None
104 
105 
106 # ###############################################################
107 
108 def isCurrentSheet(oSheet):
109  '''
110  check if sheet is the current one in its document
111  '''
112  oDoc = getDocumentFromSheet(oSheet)
113  contr = oDoc.CurrentController
114  return contr.ActiveSheet.Name == oSheet.Name
115 
116 
117 def setCurrentSheet(oSheet):
118  '''
119  set the active sheet
120  '''
121  oDoc = getDocumentFromSheet(oSheet)
122  contr = oDoc.CurrentController
123  contr.ActiveSheet = oSheet
124 
125 
126 def getCurrentSheet(oDoc):
127  '''
128  set the active sheet in given document
129  '''
130  contr = oDoc.CurrentController
131  return contr.ActiveSheet
132 
133 
134 # ###############################################################
135 
136 
137 def getSheetNames(filePath):
138  '''
139  dato il file legge i nomi dei fogli contenuti
140  '''
141  oDoc = DocUtils.loadDocument(filePath)
142  if oDoc is None:
143  return tuple()
144  sheets = oDoc.Sheets
145  res = []
146  for sheet in sheets:
147  res.append(sheet.Name)
148  oDoc.dispose()
149 
150  return tuple(res)
151 
152 
153 # ###############################################################
154 
155 
156 def tempCopySheet(oDoc, sourceName):
157  '''
158  crea una copia dello spreadsheet avente nome 'sourceName'
159  del documento 'oDoc' e lo mette in coda
160  '''
161  sheets = oDoc.Sheets
162  nSheets = sheets.Count
163  if not sheets.hasByName(sourceName):
164  return None
165 
166  while True:
167  newName = sourceName + '_' + str(int(random.random() * 10000))
168  if not sheets.hasByName(newName):
169  break
170  sheets.copyByName(sourceName, newName, nSheets)
171  newSheet = sheets.getByName(newName)
172 
173  # copiamo anche le aree di stampa e le intestazioni...
174  oldSheet = sheets.getByName(sourceName)
175  newSheet.TitleRows = oldSheet.TitleRows
176  newSheet.PrintTitleRows = oldSheet.PrintTitleRows
177  newSheet.PrintAreas = oldSheet.PrintAreas
178 
179  return newSheet
180 
181 
182 # ###############################################################
183 
184 
185 def copyPageStyle(nDoc, style):
186  '''
187  copy a page style to a given document
188  (or make properties identical if name already present)
189  '''
190  styleName = style.Name
191  nPageStyles = nDoc.StyleFamilies.getByName('PageStyles')
192 
193  if nPageStyles.hasByName(styleName):
194  # geyt page style
195  nPageStyle = nPageStyles.getByName(styleName)
196  else:
197  # create the style inside new document
198  nPageStyle = nDoc.createInstance('com.sun.star.style.PageStyle')
199 
200  # append to nDoc page styles
201  nPageStyles.insertByName(styleName, nPageStyle)
202 
203  # copy all properties
204  propSetInfo = style.PropertySetInfo
205  props = propSetInfo.Properties
206  for prop in props:
207  name = prop.Name
208  nPageStyle.setPropertyValue(name, style.getPropertyValue(name))
209 
210  # page scale is NOT correctly copied above... so do it again
211  nPageStyle.setPropertyValue('PageScale', style.getPropertyValue('PageScale'))
212 
213 
214 def paginationFields(oDoc, oTxt):
215  if oTxt.String.find('[PAGINA]') >= 0:
216  oField = oDoc.createInstance("com.sun.star.text.TextField.PageNumber")
217  LeenoUtils.replacePatternWithField(oTxt, '[PAGINA]', oField)
218 
219  if oTxt.String.find('[PAGINE]') >= 0:
220  oField = oDoc.createInstance("com.sun.star.text.TextField.PageCount")
221  LeenoUtils.replacePatternWithField(oTxt, '[PAGINE]', oField)
222 
223 
224 def pdfExport(oDoc, sheets, destPath, HeaderFooter=None, coverBuilder = None):
225  '''
226  export a sequence of spreadsheets to a PDF file
227  coverBuilder(oDoc, nDoc) takes current document as parameter, the
228  print document and adds a cover to the latter at end
229  if coverBuilder is None, no cover will be added
230  '''
231  # create an empty document
232  nDoc = DocUtils.createSheetDocument(Hidden=False)
233 
234  # if there's a cover, copy it inside the new document
235  # and fill it
236  if coverBuilder is not None:
237  hasCover = coverBuilder(oDoc, nDoc)
238  else:
239  hasCover = False
240 
241  # we need to copy the page styles too... they don't get copied
242  # along with sheet
243  styleSet = set()
244  for sheet in sheets:
245  styleSet.add(sheet.PageStyle)
246 
247  pageStyles = oDoc.StyleFamilies.getByName('PageStyles')
248  for styleName in styleSet:
249  style = pageStyles.getByName(styleName)
250  copyPageStyle(nDoc, style)
251 
252  # copy required sheets on new document it
253  # setting also the correct pagestyles...
254  # and, if present, copy print area too
255  for sheet in sheets:
256  pos = nDoc.Sheets.Count
257  nDoc.Sheets.importSheet(oDoc, sheet.Name, pos)
258  nDoc.Sheets[pos].PageStyle = sheet.PageStyle
259  if len(sheet.PrintAreas) > 0:
260  nDoc.Sheets[pos].PrintAreas = sheet.PrintAreas
261  nDoc.Sheets.removeByName(nDoc.Sheets[0].Name)
262 
263  # finally we must apply header/footers to page styles
264  # we do it ONLY on page styles which already have
265  # header or footer enabled. Other page styles (like cover ones)
266  # are left alone
267  if HeaderFooter:
268  pageStyles = nDoc.StyleFamilies.getByName('PageStyles')
269  styleSet = set()
270  for sheet in nDoc.Sheets:
271  styleSet.add(sheet.PageStyle)
272  for styleName in styleSet:
273  pageStyle = pageStyles.getByName(styleName)
274 
275  # do NOT specity first page number
276  # otherwise numbering in header/footer will be wrong
277  pageStyle.FirstPageNumber = 0
278 
279  if pageStyle.HeaderIsOn:
280  print("HEADER")
281  left = HeaderFooter.get('intSx', '')
282  center = HeaderFooter.get('intCenter', '')
283  right = HeaderFooter.get('intDx', '')
284  print(" Left :", left)
285  print(" Center:", center)
286  print(" Right :", right)
287  content = pageStyle.LeftPageHeaderContent
288  content.LeftText.String = left
289  content.CenterText.String = center
290  content.RightText.String = right
291 
292  # do PAGINA and PAGINE fields management
293  paginationFields(nDoc, content.LeftText)
294  paginationFields(nDoc, content.CenterText)
295  paginationFields(nDoc, content.RightText)
296 
297  pageStyle.RightPageHeaderContent = content
298 
299  if pageStyle.FooterIsOn:
300  print("FOOTER")
301  left = HeaderFooter.get('ppSx', '')
302  center = HeaderFooter.get('ppCenter', '')
303  right = HeaderFooter.get('ppDx', '')
304  print(" Left :", left)
305  print(" Center:", center)
306  print(" Right :", right)
307  content = pageStyle.LeftPageFooterContent
308  content.LeftText.String = left
309  content.CenterText.String = center
310  content.RightText.String = right
311 
312  # do PAGINA and PAGINE fields management
313  paginationFields(nDoc, content.LeftText)
314  paginationFields(nDoc, content.CenterText)
315  paginationFields(nDoc, content.RightText)
316 
317  pageStyle.RightPageFooterContent = content
318 
319  storeArgs = {
320  'FilterName': 'calc_pdf_Export',
321  }
322 
323  destUrl = uno.systemPathToFileUrl(destPath)
324  nDoc.storeToURL(destUrl, LeenoUtils.dictToProperties(storeArgs))
325  nDoc.close(False)
326  del nDoc
327 
328 
329 # ###############################################################
330 
331 def freezeRowCol(oSheet, row, col):
332  '''
333  freeze row and column up to row and col
334  on sheet oSheet
335  Sadly it must use the controller, so it can't be
336  done headless... but we try to preserve all we can
337  '''
338  # get document from sheet
339  oDoc = getDocumentFromSheet(oSheet)
340 
341  # get controller from document
342  controller = oDoc.CurrentController
343 
344  # if current sheet is not the one we want to setup, we
345  # must change it
346  if isCurrentSheet(oSheet):
347  curSheet = None
348  else:
349  curSheet = getCurrentSheet(oDoc)
350  setCurrentSheet(oSheet)
351 
352  # now change freeze point
353  controller.freezeAtPosition(row, col)
354 
355  # if current sheet was another one, restore it
356  if curSheet is not None:
357  setCurrentSheet(curSheet)
358 
359 
360 # ###############################################################
361 
362 
363 def setTabColor(oSheet, color):
364  '''
365  colore { integer } : id colore
366  attribuisce al tab del foglio oSheet un colore a scelta
367  '''
368  oSheet.TabColor = color
369 
370 # ###############################################################
371 
372 
373 def getUsedArea(oSheet):
374  '''
375  Restituisce l'indirizzo dell' area usata nello spreadsheet
376  in forma di oggetto CellRangeAddress
377  I membri sono:
378  Sheet numero intero indice dello Sheet contenente l'area
379  occhio che è un indice, NON un oggetto spreadsheet
380  StartColumn
381  StartRow
382  EndColumn
383  EndRow
384  '''
385  oCell = oSheet.getCellByPosition(0, 0)
386  oCursor = oSheet.createCursorByRange(oCell)
387  oCursor.gotoEndOfUsedArea(True)
388  aAddress = oCursor.RangeAddress
389  return aAddress # .EndColumn, aAddress.EndRow)
390 
391 
392 def getLastUsedRow(oSheet):
393  ''' l'ultima riga usata nello spreadsheet '''
394  return getUsedArea(oSheet).EndRow
395 
396 
397 def getLastUsedColumn(oSheet):
398  ''' l'ultima colonna usata nello spreadsheet '''
399  return getUsedArea(oSheet).EndColumn
400 
401 # ###############################################################
402 
403 def uFindStringCol(sString, nCol, oSheet, start=2, equal=0, up=False):
404  '''
405  sString { string } : stringa da cercare
406  nCol { integer } : indice di colonna
407  oSheet { object } :
408  start { integer } : riga di partenza
409  equal { integer } : se equal = 1 fa una ricerca per cella intera
410 
411  Trova la prima ricorrenza di una stringa(sString) nella
412  colonna nCol di un foglio di calcolo(oSheet) e restituisce
413  in numero di riga
414  '''
415  oCell = oSheet.getCellByPosition(0, 0)
416  oCursor = oSheet.createCursorByRange(oCell)
417  oCursor.gotoEndOfUsedArea(True)
418  aAddress = oCursor.RangeAddress
419 
420  righe = range(start, aAddress.EndRow + 1)
421  if up==True:
422  righe = reversed (righe)
423  for nRow in righe:
424  if equal == 1 and oSheet.getCellByPosition(nCol, nRow).String == sString:
425  return nRow
426  if equal == 0 and sString in oSheet.getCellByPosition(nCol, nRow).String:
427  return nRow
428 
429 def sStrColtoList(sString, nCol, oSheet, start=2, equal=0):
430  '''
431  sString { string } : stringa da cercare
432  nCol { integer } : indice di colonna
433  oSheet { object } :
434  start { integer } : riga di partenza
435 
436  Trova tutte le ricorrenze di una stringa (sString) nella
437  colonna nCol di un foglio di calcolo (oSheet) e restituisce
438  la lista delle righe
439  '''
440  oCell = oSheet.getCellByPosition(0, 0)
441  oCursor = oSheet.createCursorByRange(oCell)
442  oCursor.gotoEndOfUsedArea(True)
443  aAddress = oCursor.RangeAddress
444  ricorrenze = list()
445  for nRow in range(start, aAddress.EndRow + 1):
446  if sString.upper() in oSheet.getCellByPosition(nCol, nRow).String.upper():
447  ricorrenze.append(nRow)
448  return ricorrenze
449 
450 def uFindString(sString, oSheet, up=False):
451  '''
452  sString { string } : stringa da cercare
453  oSheet { object } :
454 
455  Trova la prima ricorrenza di una stringa(sString) riga
456  per riga in un foglio di calcolo(oSheet) e restituisce
457  una tupla(IDcolonna, IDriga)
458  '''
459  oCell = oSheet.getCellByPosition(0, 0)
460  oCursor = oSheet.createCursorByRange(oCell)
461  oCursor.gotoEndOfUsedArea(True)
462  aAddress = oCursor.RangeAddress
463  righe = range (0, aAddress.EndRow + 1)
464  if up==True:
465  righe = reversed (righe)
466 
467  for nRow in righe:
468  for nCol in range(0, aAddress.EndColumn + 1):
469  # ritocco di +Daniele Zambelli:
470  if sString in oSheet.getCellByPosition(nCol, nRow).String:
471  return (nCol, nRow)
472 
473 # ###############################################################
474 
475 def createSortField(column, sortAscending):
476  '''
477  create a sort field to be used in sortColumns()
478  column is the column to sort for (integer)
479  sortAscending is a boolean
480  '''
481  oSortField = SortField()
482  oSortField.Field = column
483  oSortField.SortAscending = sortAscending
484  return oSortField
485 
486 
487 def sortColumns(oRange, sortFields):
488  '''
489  sort a range of cells based on given sortFields
490  sortfields are given by a tuple
491  so you can order by more criterions
492  '''
493  oSortDesc = [PropertyValue()]
494  oSortDesc[0].Name = "SortFields"
495  oSortDesc[0].Value = uno.Any("[]com.sun.star.util.SortField", sortFields)
496  oRange.sort(oSortDesc)
497 
498 
499 def simpleSortColumn(oRange, column, sortAscending):
500  '''
501  simple sort of a range by a column
502  sort direction given by 'sortAscending'
503  '''
504  sortField = createSortField(column, sortAscending)
505  sortColumns(oRange, (sortField,))
506 
507 
508 # ###############################################################
509 
510 
511 def NominaArea(oDoc, sSheet, sRange, sName):
512  '''
513  Definisce o ridefinisce un'area di dati a cui far riferimento
514  sSheet = nome del foglio, es.: 'S5'
515  sRange = individuazione del range di celle, es.:'$B$89:$L$89'
516  sName = nome da attribuire all'area scelta, es.: "manodopera"
517  '''
518  sPath = "$'" + sSheet + "'." + sRange
519  oRanges = oDoc.NamedRanges
520  oCellAddress = oDoc.Sheets.getByName(sSheet).getCellRangeByName('A1').getCellAddress()
521  if oRanges.hasByName(sName):
522  oRanges.removeByName(sName)
523  oRanges.addNewByName(sName, sPath, oCellAddress, 0)
524 
525 
526 # ###############################################################
527 
528 
530  '''
531  Corregge i nomi di range dati che contengono '#' sostituendo con '_'
532  '''
533  oDoc = LeenoUtils.getDocument()
534  oRange = oDoc.NamedRanges
535  tNamedArea = oRange.ElementNames
536  for el in tNamedArea:
537  if '#' in el:
538  aName = oRange.getByName(el).ReferredCells.AbsoluteName
539  sSheet = aName.split('.')[0][1:]
540  sRange = aName.split('.')[1]
541  sName = el.replace('#', '_')
542  NominaArea(oDoc, sSheet, sRange, sName)
543  oDoc.NamedRanges.removeByName(el)
544  return
545 
546 
547 # ###############################################################
548 
549 
550 def visualizza_PageBreak(arg=True):
551  '''
552  Mostra i salti di pagina dell'area di stampa definita.
553  arg { boolean }
554  '''
555  # oDoc = LeenoUtils.getDocument()
556  # oSheet = oDoc.CurrentController.ActiveSheet
558  desktop = LeenoUtils.getDesktop()
559  oFrame = desktop.getCurrentFrame()
560  oProp = PropertyValue()
561  oProp.Name = 'PagebreakMode'
562  oProp.Value = arg
563  properties = (oProp, )
564 
565  dispatchHelper = ctx.ServiceManager.createInstanceWithContext('com.sun.star.frame.DispatchHelper', ctx)
566  dispatchHelper.executeDispatch(oFrame, ".uno:PagebreakMode", "", 0, properties)
567 
568 
569 # ###############################################################
570 
572  '''
573  unisci fogli
574  serve per unire tanti fogli in un unico foglio
575  '''
576  oDoc = LeenoUtils.getDocument()
577  lista_fogli = oDoc.Sheets.ElementNames
578  if not oDoc.getSheets().hasByName('unione_fogli'):
579  sheet = oDoc.createInstance("com.sun.star.sheet.Spreadsheet")
580  unione = oDoc.Sheets.insertByName('unione_fogli', sheet)
581  unione = oDoc.getSheets().getByName('unione_fogli')
582  test = True
583  for el in lista_fogli:
584  if test == False:
585  start = 0
586  else:
587  start = 1
588  oSheet = oDoc.getSheets().getByName(el)
589  oRangeAddress = oSheet.getCellRangeByPosition(
590  0, start, (getUsedArea(oSheet).EndColumn),
591  (getUsedArea(oSheet).EndRow)).getRangeAddress()
592  oCellAddress = unione.getCellByPosition(
593  0,
594  getUsedArea(unione).EndRow + 1).getCellAddress()
595  oSheet.copyRange(oCellAddress, oRangeAddress)
596  test = True
597  DLG.MsgBox('Unione dei fogli eseguita.', 'Avviso')
598  else:
599  unione = oDoc.getSheets().getByName('unione_fogli')
600  DLG.MsgBox('Il foglio "unione_fogli" è già esistente, quindi non procedo.', 'Avviso!')
601  oDoc.CurrentController.setActiveSheet(unione)
602 
603 
604 # ###############################################################
SheetUtils.pdfExport
def pdfExport(oDoc, sheets, destPath, HeaderFooter=None, coverBuilder=None)
Definition: SheetUtils.py:224
DocUtils.loadDocument
def loadDocument(filePath, Hidden=True)
Definition: DocUtils.py:82
SheetUtils.freezeRowCol
def freezeRowCol(oSheet, row, col)
Definition: SheetUtils.py:331
SheetUtils.replaceText
def replaceText(sheet, replaceDict)
Definition: SheetUtils.py:55
SheetUtils.hasSheetUserDefinedAttribute
def hasSheetUserDefinedAttribute(oSheet, name)
Definition: SheetUtils.py:41
LeenoUtils.dictToProperties
def dictToProperties(values, unoAny=False)
Definition: LeenoUtils.py:148
SheetUtils.getSheetNames
def getSheetNames(filePath)
Definition: SheetUtils.py:137
SheetUtils.sStrColtoList
def sStrColtoList(sString, nCol, oSheet, start=2, equal=0)
Definition: SheetUtils.py:429
SheetUtils.simpleSortColumn
def simpleSortColumn(oRange, column, sortAscending)
Definition: SheetUtils.py:499
LeenoUtils.getDocument
def getDocument()
Definition: LeenoUtils.py:67
SheetUtils.uFindStringCol
def uFindStringCol(sString, nCol, oSheet, start=2, equal=0, up=False)
Definition: SheetUtils.py:403
SheetUtils.getCurrentSheet
def getCurrentSheet(oDoc)
Definition: SheetUtils.py:126
SheetUtils.createSortField
def createSortField(column, sortAscending)
Definition: SheetUtils.py:475
SheetUtils.getSheetUserDefinedAttribute
def getSheetUserDefinedAttribute(oSheet, name)
Definition: SheetUtils.py:35
LeenoUtils.replacePatternWithField
def replacePatternWithField(oTxt, pattern, oField)
Definition: LeenoUtils.py:239
SheetUtils.getUsedArea
def getUsedArea(oSheet)
Definition: SheetUtils.py:373
SheetUtils.uFindString
def uFindString(sString, oSheet, up=False)
Definition: SheetUtils.py:450
SheetUtils.NominaArea
def NominaArea(oDoc, sSheet, sRange, sName)
Definition: SheetUtils.py:511
SheetUtils.tempCopySheet
def tempCopySheet(oDoc, sourceName)
Definition: SheetUtils.py:156
LeenoUtils.getComponentContext
def getComponentContext()
Definition: LeenoUtils.py:47
SheetUtils.FixNamedArea
def FixNamedArea()
Definition: SheetUtils.py:529
SheetUtils.getLastUsedColumn
def getLastUsedColumn(oSheet)
Definition: SheetUtils.py:397
SheetUtils.setSheetUserDefinedAttribute
def setSheetUserDefinedAttribute(oSheet, name, value)
Definition: SheetUtils.py:24
SheetUtils.MENU_unisci_fogli
def MENU_unisci_fogli()
Definition: SheetUtils.py:571
LeenoUtils.getDesktop
def getDesktop()
Definition: LeenoUtils.py:59
SheetUtils.setTabColor
def setTabColor(oSheet, color)
Definition: SheetUtils.py:363
LeenoUtils.date2String
def date2String(dat, fmt=0)
Definition: LeenoUtils.py:189
SheetUtils.paginationFields
def paginationFields(oDoc, oTxt)
Definition: SheetUtils.py:214
SheetUtils.visualizza_PageBreak
def visualizza_PageBreak(arg=True)
Definition: SheetUtils.py:550
SheetUtils.removeSheetUserDefinedAttribute
def removeSheetUserDefinedAttribute(oSheet, name)
Definition: SheetUtils.py:45
SheetUtils.getLastUsedRow
def getLastUsedRow(oSheet)
Definition: SheetUtils.py:392
SheetUtils.sortColumns
def sortColumns(oRange, sortFields)
Definition: SheetUtils.py:487
SheetUtils.isCurrentSheet
def isCurrentSheet(oSheet)
Definition: SheetUtils.py:108
SheetUtils.setCurrentSheet
def setCurrentSheet(oSheet)
Definition: SheetUtils.py:117
SheetUtils.copyPageStyle
def copyPageStyle(nDoc, style)
Definition: SheetUtils.py:185
SheetUtils.getDocumentFromSheet
def getDocumentFromSheet(oSheet)
Definition: SheetUtils.py:76
DocUtils.createSheetDocument
def createSheetDocument(Hidden=True)
Definition: DocUtils.py:100