Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

how to Increase row height in excel report formatting Odoo 13

Subscriure's

Get notified when there's activity on this post

This question has been flagged
excelformattingstylesheetrows
2 Respostes
4919 Vistes
Avatar
Farooq Butt

I have to set heading in excel report in odoo 13 but the height of heading and all other rows are same. how to increase row height for heading row using formatting e.g

table_heading_style = xlwt.easyxf(
'font: bold on,height 220;align: wrap on,vert centre, horiz center; align: wrap yes,vert centre, horiz center;pattern: pattern solid, fore-colour aqua;border: left thin,right thin,top thin,bottom thin')


0
Avatar
Descartar
Avatar
Midhun M M
Best Answer
Please check 

from odoo import models
from odoo.fields import Date
from datetime import date, datetime
import dateutil.relativedelta

fs = Date.from_string
ts = Date.to_string


class CalibExcelReport(models.AbstractModel):
_name = "report.calibration_tracking.calib_xlsx_document"
_inherit = "report.report_xlsx.abstract"
_description = "Calibration XLSX Report"

def generate_xlsx_report(self, workbook, data, vals):
cell_text_format = workbook.add_format({'align': 'center', 'bold': True, 'font_size': 12, 'bg_color': '#FF9933'})
head = workbook.add_format({'align': 'center', 'bold': True,'size': 14, 'bg_color': '#6B8E23'})
head1 = workbook.add_format({'align': 'left', 'bold': True, 'size': 12, 'bg_color': '#D3D3D3'})
head2 = workbook.add_format({'align': 'left', 'size': 12})
head3 = workbook.add_format({'align': 'left', 'bold': True, 'size': 12})
format1 = workbook.add_format({'align': 'center', 'font_size': 10})
format2 = workbook.add_format({'align': 'center', 'bold': True, 'font_size': 10, 'border': 1, 'bg_color': '#D3D3D3'})
format3 = workbook.add_format({'align': 'center', 'font_size': 10, 'border': 1})
format6 = workbook.add_format({'align': 'center', 'font_size': 10})
worksheet = workbook.add_worksheet('Report')
worksheet.set_column('A:A', 6,)
worksheet.set_column('B:B', 20)
worksheet.set_column('C:C', 20)
worksheet.set_column('D:D', 20)
worksheet.set_column('E:E', 20)
worksheet.set_column('F:F', 20)
worksheet.set_column('G:G', 20)
worksheet.set_column('H:H', 20)
worksheet.set_column('I:I', 20)
worksheet.set_column('J:J', 25)
worksheet.set_column('K:K', 20)
worksheet.set_column('L:L', 20)
row = 2
column = 0

worksheet.merge_range(row, column, row + 1, column + 12, 'Calibration Instrument Master List', head)
row = 5
column = 0

worksheet.write(row, column, 'SL. No', cell_text_format)
worksheet.write(row, column + 1, 'DESCRIPTION', cell_text_format)
worksheet.write(row, column + 2, 'Range', cell_text_format)
worksheet.write(row, column + 3, 'Make', cell_text_format)
worksheet.write(row, column + 4, 'Sl.No', cell_text_format)
worksheet.write(row, column + 5, 'ID NUMBER', cell_text_format)
worksheet.write(row, column + 6, 'CALIBRATED ON', cell_text_format)
worksheet.write(row, column + 7, 'CALIBRATION DUE', cell_text_format)
worksheet.write(row, column + 8, 'LOCATION', cell_text_format)
worksheet.write(row, column + 9, 'TEST CERTIFICATE NO', cell_text_format)
worksheet.write(row, column + 10, 'STATUS/REMARKS', cell_text_format)
worksheet.write(row, column + 11, 'VERIFIED ', cell_text_format)
calibrations = []
if data['date_range_based']:
calibrations = self.env['instrument.calibration'].search([('last_due_date', '>=', data['from_date'])]).filtered(lambda s:s.last_due_date != False and s.last_calib_date != False)
if data['month_based']:
due_date = (date.today() + dateutil.relativedelta.relativedelta(months=int(data['notify_date'])))
calibrations = self.env['instrument.calibration'].search([('last_due_date', '<=', due_date)]).filtered(lambda s:s.last_due_date != False and s.last_calib_date != False)
calib_list = []
if calibrations:
i = 1
for calib in calibrations:
vals = {'no': i,
'desc': calib.product_desc,
'range': calib.range,
'make': calib.instrument_make.name if calib.instrument_make else False,
'sl': calib.sl_no,
'id_no': calib.id_number,
'calib_date': calib.last_calib_date.strftime('%d/%m/%Y') if calib.last_calib_date else False,
'calib_due': calib.last_due_date.strftime('%d/%m/%Y') if calib.last_due_date else False,
'location': calib.location_id.name if calib.location_id else False,
'cert_no': calib.last_certi_no,
'status': calib.status,
'verified': calib.calib_verify}
calib_list.append(vals)
i = i+1
print(calib_list)
row = 6
for ca_list in calib_list:

worksheet.write(row + 1, column + 0, ca_list['no'], format1)
worksheet.write(row + 1, column + 1, ca_list['desc'], format1)
worksheet.write(row + 1, column + 2, ca_list['range'], format1)
worksheet.write(row + 1, column + 3, ca_list['make'], format1)
worksheet.write(row + 1, column + 4, ca_list['sl'], format1)
worksheet.write(row + 1, column + 5, ca_list['id_no'], format1)
worksheet.write(row + 1, column + 6, ca_list['calib_date'], format1)
worksheet.write(row + 1, column + 7, ca_list['calib_due'], format1)
worksheet.write(row + 1, column + 8, ca_list['location'], format1)
worksheet.write(row + 1, column + 9, ca_list['cert_no'], format1)
worksheet.write(row + 1, column + 10, ca_list['status'], format1)
worksheet.write(row + 1, column + 11, ca_list['verified'], format1)
row +=1



0
Avatar
Descartar
Avatar
Jitendra Bhatt
Best Answer

Please try below code.

from openpyxl import Workbook

workbook = Workbook(write_only=False)
worksheet = workbook.active
worksheet.row_dimensions[1].height = 70

Please find the more information: https://www.geeksforgeeks.org/python-adjusting-rows-and-columns-of-an-excel-file-using-openpyxl-module/

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Line Spacing in Odoo 17 Solved
formatting
Avatar
Avatar
Avatar
3
de set. 25
3614
Cant download excel data from v11 using chrome anymore Solved
excel
Avatar
Avatar
1
de nov. 22
3262
phone formatting feature
formatting
Avatar
Avatar
1
de nov. 22
8715
ODOO 12 how can we generate Excel report Solved
excel
Avatar
Avatar
Avatar
Avatar
7
de gen. 24
16446
how to write an excel file into a field who is a field.Binary()?
excel
Avatar
0
de febr. 17
4137
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now