Bug 58719 - Horizontal alignment is not rendered correctly in Safari for IOS
Summary: Horizontal alignment is not rendered correctly in Safari for IOS
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.13-FINAL
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-11 04:44 UTC by Jun Whang
Modified: 2019-01-06 13:00 UTC (History)
0 users



Attachments
Original test file which displays improperly in Safari (3.26 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2015-12-11 19:02 UTC, Jun Whang
Details
Original example file opened in Excel, then saved with a different name (7.82 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2015-12-11 19:03 UTC, Jun Whang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jun Whang 2015-12-11 04:44:26 UTC
Assigning styles which apply horizontal alignment appears correctly in Excel, but not in Safari for IOS.  Test code below produces output which has a left and right alignment applied to different cells, but they render as left alignment in both cases when viewed in Safari for IOS:

...
public void test(){
		XSSFWorkbook wb = new XSSFWorkbook();
		XSSFSheet sheetA = wb.createSheet("sheet_a");
		Row row0 = sheetA.createRow(0);
		
		XSSFCellStyle styleA = wb.createCellStyle();
		styleA.setAlignment(HorizontalAlignment.LEFT);
		XSSFCellStyle styleB = wb.createCellStyle();
		styleB.setAlignment(HorizontalAlignment.RIGHT);
		
		Cell cellA0 = row0.createCell(0);
		cellA0.setCellStyle(styleA);
		cellA0.setCellValue("asdf");
		Cell cellB0 = row0.createCell(1);
		cellB0.setCellStyle(styleB);
		cellB0.setCellValue("qwerty");
		
		try{
		    FileOutputStream fileOut = new FileOutputStream("exampleFile.xlsx");
		    wb.write(fileOut);
		    fileOut.close();
		} catch (IOException ioe){
			ioe.printStackTrace();
		}
	}
...
Comment 1 Javen O'Neal 2015-12-11 06:27:08 UTC
How does the XML compare between what's generated by POI and what's generated by Excel, LibreOffice, or OpenOffice?

How does a file that is created in Excel, with horizontally aligned cells look in Safari for iOS?

I don't have an iOS device, so I can't test this to determine if this is a bug in Safari or POI. Can Safari natively display OpenXML files? That's cool. Firefox and Chrome can't.
Comment 2 Jun Whang 2015-12-11 19:02:53 UTC
Created attachment 33338 [details]
Original test file which displays improperly in Safari
Comment 3 Jun Whang 2015-12-11 19:03:37 UTC
Created attachment 33339 [details]
Original example file opened in Excel, then saved with a different name
Comment 4 Jun Whang 2015-12-11 19:15:17 UTC
I ran a recursive diff between the contents of the two files; I notice that the MS version has theme assets but the overall structure looks similar otherwise.  When viewing the file level diffs, they have numerous deltas but I'm not sure which ones are meaningful.  Please let me know if you want me to zip up the delta reports and attach it to this bug.


I attached the original test file as well as a version of that file saved by MS Excel.  The differences in behavior are:

--Original test file created via test program in initial description (exampleFile.xlsx):
- displays correctly in MS Excel (one cell left aligned, other cell right aligned)
- displays correctly in Google Drive viewer
- on download request, renders *incorrectly* in Safari with both cells left aligned.

--Test file created from MS Excel by saving original test XSLX file(exampleFile_Excel_saved.xlsx):
- displays correctly in MS Excel (one cell left aligned, other cell right aligned)
- displays correctly in Google Drive viewer
- on download request, renders in Safari *correctly* with one cell left aligned, other cell right aligned.


It appears Safari can display this content; with the exception of this issue, more complex content appears to be rendering correctly.  I'm checking the functionality by uploading the XLSX file to a google drive location.  Selecting the file displays the content in Google's browser renderer, but choosing to download the file is when Safari appears to take over to render the file.