Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
7961 Lượt xem

In a pdf report of multiple pages, is it possible that the header and footer is only shown in the first page of the report ?


For example

- Page 1 = Header (company information + logo ...)

- Page 2 = [... Some content and data ...] without header

- Page 3 = [... More content and data ...] without header


If yes, how can I do that ? Is there a special attribute or class usable in qweb ?

Thank you in advance,

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

in addition, this module can also be used as a solution: https://apps.odoo.com/apps/modules/14.0/report_qweb_element_page_visibility/

Ảnh đại diện
Huỷ bỏ
Tác giả

Ohh really nice thank you.
I'll try as soon as possible

I tried it and it works perfectly, thank you

Tác giả Câu trả lời hay nhất

I really needed the header different in first page so temporary I tried to do something.
Here the result (It's a drive link cause I'm don't have enough access to post files):

https://drive.google.com/file/d/1wWn7q2n3jgBJuAuEr--cEtkEaQLI_e1X/view?usp=sharing



How I did it:

  • I used the layout "web.internal_layout" for my report by inheriting
  • In my inherited view I removed the header:
    xpath expr="//div[hasclass('header')]/div[hasclass('row')]" position="replace"
  • In my report template I tried to create a "looks like" header.
    And then I put it in the body of my qweb report.


It's really not a good solution cause it's not the standard using of Odoo.

So I still need help if someone have a better solution

Thank you all,


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello, Loic

If you place the header content directly as part of the report body, it will only appear on the first page. Obviously, this way it won't be a header. However, I think it will solve your problem without the need to use an external module.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 10 15
23094
0
thg 5 22
3906
1
thg 12 20
6697
3
thg 12 16
9811
1
thg 3 15
7912