Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How can I change a report to landscape format?

Subscribe

Get notified when there's activity on this post

This question has been flagged
openofficev7reportportraitlandscape
2 Replies
21932 Views
Avatar
Gilles Lehoux

I opened the invoice report using the OpenOffice OpenERP plugin. I changed the page format to landscape then sent it to the server. I took the opportunity to rename the report to Invoice Landscape, just so that I knew it had arrived. I refreshed the browser. Clicked the button to print the invoice. The browser shows "Still loading" for 15 minutes.

I have my doubts about this approach. There is a "Page Format" setting (Settings/Company/General Information/Page Format) which can be set either to A4 or Letter. Also the the RML of the header and footer is available for editing. If the Header is simply prepended to the report I've uploaded from OpenOffice then how will the header know to switch to Landscape?

If the OpenOffice upload changes to A4 page format but the OpenERP setting is Letter, who has precedence? I'm left to wonder about this because my uploads don't print.

2
Avatar
Discard
Niyas Raphy (Walnut Software Solutions)

Landscape: https://www.youtube.com/watch?v=k5edcLqN-CI

Avatar
fudo
Best Answer

Update answer for Piotr Cierkosz:

To do this, you need to add Landscape into your custom paperformat, and then, call it in your report xml

Full code:





<!-- custom pager format -->
<record id="paperformat_student_report" model="report.paperformat">
<field name="name">Custom Paperformat for the Student report</field>
<field name="default" eval="False"/>
<field name="disable_shrinking" eval="True"/>
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<!-- this one is to make the pdf to become horizontal, if landscape=False, pdf will become vertical -->
<field name="orientation">Landscape</field>
<field name="margin_top">0</field>
<field name="margin_bottom">8</field>
<field name="margin_left">0</field>
<field name="margin_right">0</field>
<field name="dpi">96</field>
</record>

<!-- pdf version -->
<record id="action_report_student" model="ir.actions.report" style="color:#e8bf6a;">>
<!-- this field will show as name of the button,
also will be the name of exported file, unless we use print_report_name as below -->
<field name="name">Students</field>
<field name="model">school.students</field>
<field name="report_type">qweb-pdf</field>
<!-- In single report, this print_report_name will be use as dynamic name of the file.
But in multiple reports, this will not work, it will use <field name="name"> as file name.
So we should use print_report_name for single report, and <field name="name"> to multiple reports.
-->
<field name="print_report_name">'Student - [%s]' % (object.sequence).replace('/', '')</field>
<!-- the view file is declare in this variable -->
<field name="report_name">school.report_student</field>
<!-- not sure what this for -->
<field name="report_file">school.report_student</field>
<!-- not sure what this for -->
<field name="binding_model_id" ref="model_school_students"/>
<field name="binding_type">report</field>
<!-- custom pager format -->
<field name="paperformat_id" ref="paperformat_student_report"/>
</record>

 



If you call report from a python code, then try this instead:

Add .with_context(landscape=True) to your py code:

Example:

report_action = self.env.ref('school.action_report_calendar').with_context(landscape=True).report_action(self, data=data)

Hope it helped.

0
Avatar
Discard
Avatar
Piotr Cierkosz
Best Answer

You can do it by changing the QWeb attribute called "Orientation":

<field name="orientation">Landscape</field>

Official documentation is here:

https://www.odoo.com/documentation/10.0/reference/reports.html#paper-format

 

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

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

Sign up
Related Posts Replies Views Activity
Odoo - same report landscape / portrait
report portrait landscape
Avatar
Avatar
1
Mar 24
2046
Multiple formats on the same pdf report
report portrait landscape
Avatar
0
Nov 15
4904
How can I create a new report in Open Office ?
openoffice v7 report
Avatar
Avatar
1
Mar 15
6258
repeatin error on empty list Solved
openoffice v7 report repeatin
Avatar
Avatar
Avatar
2
Dec 22
7572
OpenERP Report Designer fails to Send to the server
error openoffice v7 report
Avatar
Avatar
Avatar
Avatar
3
Mar 15
6555
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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