Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

how to Increase row height in excel report formatting Odoo 13

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
excelformattingstylesheetrows
2 Réponses
4911 Vues
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
Ignorer
Avatar
Midhun M M
Meilleure réponse
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
Ignorer
Avatar
Jitendra Bhatt
Meilleure réponse

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
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Line Spacing in Odoo 17 Résolu
formatting
Avatar
Avatar
Avatar
3
sept. 25
3609
Cant download excel data from v11 using chrome anymore Résolu
excel
Avatar
Avatar
1
nov. 22
3260
phone formatting feature
formatting
Avatar
Avatar
1
nov. 22
8706
ODOO 12 how can we generate Excel report Résolu
excel
Avatar
Avatar
Avatar
Avatar
7
janv. 24
16442
how to write an excel file into a field who is a field.Binary()?
excel
Avatar
0
févr. 17
4128
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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