İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

How to add image in excel report using python xlwt ?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
pythonimagereportexcelxlwt
3 Cevaplar
24056 Görünümler
Avatar
Jignesh Mehta

Hello All,

I am creating excel report using python xlwt. When i add the image in it, it gives me error.

Error :-

IOError: [Errno 36] File name too long:


Edited Code :-

@api.multi

def print_excel_report(self):

     filename= 'Products.xls'

     workbook= xlwt.Workbook(encoding="UTF-8")


     if self.product_line:

        worksheet= workbook.add_sheet('products')       

        font = xlwt.Font()       

        font.bold = True

         for_left = xlwt.easyxf("font: bold 1, color black; borders: top double, bottom double, left double, right double; align: horiz left")       

        for_left_not_bold = xlwt.easyxf("font: color black; borders: top double, bottom double, left double, right double; align: horiz left")       

        for_center_bold = xlwt.easyxf("font: bold 1, color black; align: horiz center")

        GREEN_TABLE_HEADER = xlwt.easyxf(             

                                        'font: bold 1, name Tahoma, height 250;'                

                                        'align: vertical center, horizontal center, wrap on;'                

                                        'borders: top double, bottom double, left double, right double;'                

                                        'pattern: pattern solid, pattern_fore_colour blue, pattern_back_colour dark_red_ega'                                                         )       

        style = xlwt.easyxf('font:height 400, bold True, name Arial; align: horiz center, vert center;borders: top medium,right medium,bottom medium,left medium')
        alignment = xlwt.Alignment()

        alignment.horz = xlwt.Alignment.HORZ_RIGHT       

        style = xlwt.easyxf('align: wrap yes')       

        style.num_format_str = '0.00'


        worksheet.row(0).height = 320       

        worksheet.col(0).width = 2000       

        worksheet.col(1).width = 2000       

        borders = xlwt.Borders()

        borders.bottom = xlwt.Borders.MEDIUM       

        border_style = xlwt.XFStyle()

        border_style.borders = borders
        worksheet.write_merge(0,1,0,9,'Product',GREEN_TABLE_HEADER)


        row = 3       

        worksheet.write(row, 0, 'Name', for_left)       

        worksheet.write(row, 1, 'Image', for_left)       

        worksheet.write(row, 2, 'Price', for_left)


        for product in self.product_line:
            row = row+1           

            worksheet.write(row, 0, product.name or '',for_left_not_bold)           

            worksheet.write(row, 1, product.image_medium or '',for_left_not_bold)           

            worksheet.write(row, 2, product.list_price or '',for_left_not_bold)


     fp = StringIO()   

    workbook.save(fp)

     export_id = self.pool.get('excel.extended').create(self._cr, self._uid, {'excel_file': base64.encodestring(fp.getvalue()), 'file_name': filename}, context=self._context)   

    fp.close()



How to solve this or how to add image in the excel file ?

Any suggestion from is appreciated.


Thanks in advance.

1
Avatar
Vazgeç
Avatar
Axel Mendoza
En İyi Yanıt

Hi Jignesh Mehta

Read how you can solve that here:

https://www.odoo.com/es_ES/forum/ayuda-1/question/add-signature-image-stored-in-database-to-excel-file-91361#answer-91367

3
Avatar
Vazgeç
Jignesh Mehta
Üretici

Hello @Axel Mendoza, I am not using openpyxl for creating xls report. I want to insert image using xlwt. I have added the method for creating xls report. Thanks,

Axel Mendoza

Those posts talk about the problem of generating an xlwt report using an inmemory image data that it's not suitable with xlwt because it's not allow you to pass a file-like object, it just work with filenames for that, at least in previous versions, so if you wanna do that you should save the image on a temp file to pass the filename to xlwt, as my answer suggest in that thread

Hope you solve it

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

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Generate excel with a button
python report excel odoo12
Avatar
1
Tem 21
176
Excel report
python report excel odoo12
Avatar
0
Nis 21
331
How to get the data inorder to generate an excel report? Çözüldü
python report excel table odoo10
Avatar
Avatar
Avatar
2
Ara 24
7410
How to calculator all values Amount Total
python report
Avatar
0
Ağu 19
4000
Error: Sum all values in amount_total
python report
Avatar
Avatar
Avatar
Avatar
4
Ağu 19
5252
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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