Bug 48767

Summary: Page orientation is not saved/loaded in/from .xlsx format
Product: LibreOffice Reporter: Yogurt <joghurt>
Component: SpreadsheetAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium CC: norbert.notz, suokunlong, tomdkat
Version: 3.5.2 release   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Landscape A4 page saved by LibO Calc
Landscape A4 page saved by MS Excel
xlsx file saved by LO 4.1.4.2.
xlsx file saved by MSO 2010

Description Yogurt 2012-04-16 05:11:09 UTC
Created attachment 60059 [details]
Landscape A4 page saved by LibO Calc

Steps to reproduce:
1. Create new spreadsheet.
2. Go to Format / Page... / Page.
3. Set Landscape page orientation (or exchange dimensions so that width is greater than height).
4. Write anything into the bottom-right cell of the page, marked by the dashed lines.
5. Save in Office Open XML (.xlsx) format.
6. Load the saved file either in LibO or MS Excel.

Expected:
Conserving landscape page orientation.

What happens:
Page is reverted to portrait.

Note #1: The same thing works perfectly with LibO Writer and the .docx file format. So this is a Calc-only bug.

Note #2: This bug may be connected to Bug 40146.
Comment 1 Yogurt 2012-04-16 05:11:39 UTC
Created attachment 60060 [details]
Landscape A4 page saved by MS Excel
Comment 2 Markus Mohrhard 2012-04-23 14:41:32 UTC
*** Bug 49084 has been marked as a duplicate of this bug. ***
Comment 3 OfficeUser 2012-04-24 12:09:40 UTC
I have adjusted the summary since trying to import an landscape formatted xlsx produced by Excel revealed that LibO's import filter also fails to handle landscape format in xlsx.
Comment 4 Tom Williams 2013-05-06 22:02:11 UTC
I've just encountered this using LibreOffice 4.0.3.2 (rc2) on Ubuntu 13.04 Linux (64-bit).  When I load a spreadsheet with a landscape page orientation that I created in LibreOffice and saved in Excel 2007/2010 format in LibreOffice, the landscape page orientation is preserved.  When I open that same document in Excel 2007 on Windows XP, the page orientation is portrait.
Comment 5 Kevin Suo 2013-12-27 09:26:37 UTC
Tested in LibreOffice 4.1.4.2 and 4.2.0.1:

1. New spreadsheet, input something;
2. Set page to landscape;
2. Save as ms-office-2007/2010 (.xlsx);
3. Load in LibreOffice, page is Landscape;
4. Load in MSO 2010, page is Portrait

So:
LO knows the page is Landscape,
but MSO dont know it.

Further testing:
5. Set the page as Landscape in MSO, save.
6. Open in LibreOffice, page is Landscape.
7. Do some editing, save, and load in MSO, page is Portrait again.

So, LO exported the wrong page orientation info in xlsx.
Comment 6 Kevin Suo 2013-12-27 09:49:46 UTC
(In reply to comment #5)
> Tested in LibreOffice 4.1.4.2 and 4.2.0.1:

> 2. Save as ms-office-2007/2010 (.xlsx);

unzip the xlsx file saved by LibreOffice, I found the following in /xl/worksheets/sheet1.xml:
<pageSetup blackAndWhite="false" cellComments="none" copies="1" draft="false" firstPageNumber="1" fitToHeight="1" fitToWidth="1" horizontalDpi="300" orientation="landscape" pageOrder="downThenOver" paperSize="9" scale="100" useFirstPageNumber="true" usePrinterDefaults="false" verticalDpi="300"/>

> Further testing:
> 5. Set the page as Landscape in MSO, save.

unzip the xlsx file save by MSO, I found the following in /xl/worksheets/sheet1.xml:
<pageSetup paperSize="9" orientation="landscape" useFirstPageNumber="1" horizontalDpi="300" verticalDpi="300" r:id="rId1"/>

They are all orientation="landscape", except that xlsx save by LO is much "bigger" (have more xml attributes).
So why is it portrait when load in MSO? A MSO bug?
Comment 7 Kevin Suo 2013-12-27 09:52:45 UTC
Created attachment 91212 [details]
xlsx file saved by LO 4.1.4.2.

 the page should be landscape, but appears portrait when loaded in MSO 2010.
Comment 8 Kevin Suo 2013-12-27 09:54:20 UTC
Created attachment 91213 [details]
xlsx file saved by MSO 2010

the page is landscape when loaded in LO or MSO.
But when edited by LO and save, it's portrait again when loaded in MSO.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.