Conjunto de cambios c079de3 en seiven para gestion_informacion


Ignorar:
Fecha y hora:
08/08/2017 13:58:38 (hace 7 años)
Autor:
Luis Barrios <nikeven@…>
Branches:
master
Children:
e214583
Parents:
40567da
Mensaje:

modificada descarga de archivo para precios

Fichero:
1 editado

Leyenda

No modificado
Añadido
Eliminado
  • gestion_informacion/ajax.py

    r2037da0 rc079de3  
    7373        modelo = apps.get_model(app, mod)
    7474        workbook = xlwt.Workbook()
    75         sheet = workbook.add_sheet("Datos")
     75        sheet = workbook.add_sheet("Datos",cell_overwrite_ok=True)
    7676        instance = modelo()
    7777        datos = instance.gestion_init(**filter)
    7878        i = 0
    7979        for con in datos['fields']:
    80             index_col = 0
    81             style='align: horiz center;'
     80            index_col= 0
     81            style='align: horiz center; align: vert center;'
    8282            for cabecera in con:
    8383                if 'color' in cabecera:   
     
    8787                font_bold = xlwt.easyxf(style)
    8888                sheet.write(i, index_col, cabecera['tag'], font_bold)
     89                sheet.set_shrink()
     90               
    8991                if 'cabecera' in cabecera:
    9092                    sheet.col(i).width = int (333 * (len(cabecera['tag']) + 1))
    91                 index_col += 1
     93               
     94                if 'combine' in cabecera and cabecera['combine'] > 0:
     95                    sheet.merge(i, i, index_col, (index_col + (cabecera['combine']-1)), font_bold)
     96                    index_col = cabecera['combine'] + index_col
     97
     98                if 'dominio'in cabecera:
     99                    sheet.write(i, 2, cabecera['tag'], font_bold)
     100                if 'combine_row' in cabecera:
     101                    sheet.write_merge(i, i+10, 0,0, cabecera['tag'],font_bold)
     102                if 'combine_row1' in cabecera:
     103                    sheet.write_merge(i, i+10, 1,1, cabecera['tag'],font_bold)
     104                else:
     105                    index_col += 1           
    92106            i += 1
    93107
Nota: Vea TracChangeset para ayuda en el uso del visor de conjuntos de cambios.