calc headers : is there a way to have them on foreground in libreoffice calc

I am using calc to print multipage tables. I marked the first 3 rows of the table to be repeated on every page. Those rows contain data like the name of the table, company logo or others and are surrounded by a black border so they form a nice frame at the beginning of every page. Now I also want the page number to appear within this area (within the described frame). When I define a header with the page number in the page format and configure it so that the page number is within this rectangle, it gets invisible because it is covered by those 3 rows, although in the area where the header page number goes there is no data. Is there a way to make the header go on the foreground so this pagenumber is visible ?

Opening xls files with a similar header in LO shows the page number visible within this frame, but as soon as you touch the header configuration, they dissapear below this frame.

Any solution for that ?

I could define the whole frame within the header since I can draw borders around it in the page format-header tab, but in some cases data within the frame is used in other cells of the table, or data within the frame comes from some other cell in the table, and this seems not to be possible when the whole frame is defined within the page formatting - header tab