After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 724516 - header/footer round trip issues
header/footer round trip issues
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export MS Excel (tm)
git master
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2014-02-17 01:48 UTC by Andreas J. Guelzow
Modified: 2014-02-24 03:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gnumeric file (1.68 KB, application/x-gnumeric)
2014-02-22 21:51 UTC, Andreas J. Guelzow
Details

Description Andreas J. Guelzow 2014-02-17 01:48:29 UTC
header/footer info appears not to round trip through xlsx
Comment 1 Morten Welinder 2014-02-17 01:55:41 UTC
Did you mean xls/biff7?
Comment 2 Andreas J. Guelzow 2014-02-17 02:37:29 UTC
No, I meant ECMA v2 (xlsx).

For example if you set the top left to the form (Page 1 of 12), save and reopen, it is gone.
Comment 3 Morten Welinder 2014-02-20 20:16:00 UTC
This is now t6503, for multiple formats.


biff7 was fixed yesterday.


xlsx still fails:

-        <gnm:Header Left="&amp;[FILE]" Middle="&amp;[TAB]" Right="&amp;[PAGE]/&amp;[PAGES]"/>
-        <gnm:Footer Left="date:&amp;[DATE]" Middle="&amp;[PATH]" Right="time:&amp;[TIME]"/>
+        <gnm:Header Left="" Middle="&amp;[TAB]" Right=""/>
+        <gnm:Footer Left="" Middle="Page &amp;[PAGE]" Right=""/>


ods also fails.  If this difference is beneign (or unavoidable) then we
can tell the test to be quiet.

-        <gnm:Footer Left="date:&amp;[DATE]" Middle="&amp;[PATH]" Right="time:&amp;[TIME]"/>
+        <gnm:Footer Left="date:&amp;[DATE:dd-mmm-yyyy]" Middle="&amp;[PATH]" Right="time:&amp;[TIME:hh&quot;:&quot;mm]"/>
Comment 4 Morten Welinder 2014-02-21 00:57:01 UTC
We now export headers and footers to xlsx.   Still no import, but LO is
happy with what we write.
Comment 5 Andreas J. Guelzow 2014-02-21 04:48:15 UTC
The ODF round trip issue has been fixed.
Comment 6 Andreas J. Guelzow 2014-02-22 21:51:34 UTC
Created attachment 270014 [details]
gnumeric file

If I save the attached file as ECMA ed 2 (xlsx) and try to open it with Excel 2013 I get an error and the following explanation for the fix:
"Replaced Part: /xl/worksheets/sheet1.xml part with XML error. Load error. Line 30, column 16."

The opened file has lost its headers/footer and content.
Comment 7 Andreas J. Guelzow 2014-02-22 21:55:11 UTC
line 30 does not have 16 columns, line 31 does. All of this is in the newly added headerFooter element.
Comment 8 Morten Welinder 2014-02-22 22:46:09 UTC
Hmm.   Could you try saving the same page setup in Excel to see what it
generates?
Comment 9 Morten Welinder 2014-02-22 23:12:44 UTC
I have a random file that contains this in one of the sheets.

  <headerFooter>
    <oddHeader>&amp;C&amp;"times ,Bold"&amp;12Table A-1 IAFIS Average Transaction Response Times</oddHeader>
    <oddFooter>&amp;L&amp;"times,Bold"IAFIS-DOC-01078-9.4 Draft
EBTS Appendix A&amp;C&amp;"times,Bold"Page A-&amp;P&amp;R&amp;"times,Bold"September 14, 2012</oddFooter>
  </headerFooter>

The file triggering complaints contains...

  <headerFooter>
    <oddHeader>&amp;L&amp;A&amp;CPage &amp;P of &amp;N&amp;R&amp;D</oddHeader>
    <oddFooter>&amp;L&amp;C&amp;T&amp;R</oddFooter>
  </headerFooter>
Comment 10 Morten Welinder 2014-02-23 17:58:20 UTC
there's nothing wrong with the header-footer section, except that
Excel wants it *before*

  <rowBreaks count="0"/>
  <colBreaks count="0"/>
Comment 11 Andreas J. Guelzow 2014-02-23 19:20:04 UTC
Excel is very particular about the order of child elements (as specified in the schema). Everybody else is more easy going.
Comment 12 Morten Welinder 2014-02-23 20:08:11 UTC
xlsx ought to be fixed.  I cannot test from here.
Comment 13 Andreas J. Guelzow 2014-02-23 21:16:48 UTC
Excel is now happy with the created xlsx file.
Comment 14 Morten Welinder 2014-02-23 22:22:39 UTC
xlsx import added.

This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
Comment 15 Andreas J. Guelzow 2014-02-24 02:09:54 UTC
xls (MS ExcelTM 97/2000/XP & 5.0/95) round trip might work but xls (MS ExcelTM 97/2000/XP & 5.0/95) export does not work correctly. If you save the file of comment #6 as xls (MS ExcelTM 97/2000/XP & 5.0/95) and open it in Excel 2013, and print the file, the header reads:
TAB]     Page PAGE] of PAGES]   DATE]
and the footer reads
               TIME]

Apparently we are exporting Gnumeric's tags &[PAGE] etc. rather than the expected tags &P etc.

Since round trip works, I suspect we are making a corresponding mistake on import.
Comment 16 Morten Welinder 2014-02-24 02:17:44 UTC
We crudely dump them into the file:

	if (hf->left_format != NULL) {
		g_string_append (res, "&L");
		g_string_append (res, hf->left_format);
	}

I expect some of the translation code I wrote for xlsx can be used for this
too.
Comment 17 Morten Welinder 2014-02-24 03:11:14 UTC
xls export fixed.  (Roundtrip dutifully fails.)
Comment 18 Morten Welinder 2014-02-24 03:22:15 UTC
xls import fixed.  We roundtrip again, so I'm feeling lucky:

This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.