Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after saving, file looks different #81

Closed
plandem opened this issue Jul 14, 2017 · 16 comments
Closed

after saving, file looks different #81

plandem opened this issue Jul 14, 2017 · 16 comments

Comments

@plandem
Copy link

plandem commented Jul 14, 2017

  1. open xlsx (quite complex formatting - styles and etc)
  2. copy from Col A into Col B
  3. set Col A equal 0
  4. save as a new file - files looks different :(

some cells at each row can be merged, BUT Col A, and Col B are simple - only style formatting.

More overs, some rows(quite a lot) that I'm not updating - after saving looks different.

Let's recap - I only update some simple cells at some rows. Why rows that I'm not touching looks different?! :(

@xuri
Copy link
Member

xuri commented Jul 15, 2017

Hi Andrey, please provide file attachments If you can.

@plandem
Copy link
Author

plandem commented Jul 15, 2017

hi. I will try to remove critical data and prepare file for you.
Btw...what edition is your library based on?!

http://www.ecma-international.org/publications/standards/Ecma-376.htm

@xuri
Copy link
Member

xuri commented Jul 15, 2017

The lib is based on the ECMA-376 5th edition.

@plandem
Copy link
Author

plandem commented Jul 15, 2017

ok, here are files:

before updating
https://www.dropbox.com/s/h5doil7usuw3zhs/before.xlsx?dl=0

after updating
https://www.dropbox.com/s/0yo3mwk1mcpgic8/after.xlsx?dl=0

What steps to reproduce:

  1. open before
  2. at sheet 3.1 set 2 values - row 10
  3. at sheet 3.2 set 2 values - row 37
  4. save as a new file

Open a new file and you will see that at sheet 3.2 we have broken formatting.

I can't provide any data(to much to cleanup), but right now looks like only formatting on this page breaks. 3.1 looks fine.

P.S.: file size of after is much lesser (about 300k)

@plandem
Copy link
Author

plandem commented Jul 15, 2017

@xuri Probably it's a good idea to write at Readme about ECMA-376 5th edition

xuri added a commit that referenced this issue Jul 15, 2017
@xuri
Copy link
Member

xuri commented Jul 15, 2017

Thanks for your issue, I have fixed it by adding missing element showWhiteSpace in the worksheet. Please upgrade lib to the last version.

@plandem
Copy link
Author

plandem commented Jul 15, 2017

Well, it's much better now, but still looks different.

before (3.8Mb file):
https://www.dropbox.com/s/23s3i0rpss6ahyp/Screenshot%202017-07-15%2019.56.27.png?dl=0

after(3.3Mb file):
https://www.dropbox.com/s/rmp951a4xodzgfi/Screenshot%202017-07-15%2019.56.51.png?dl=0

have no ideas why :( And file is still lesser by 500kb after saving :( 500Kb somewhere gone.

@plandem
Copy link
Author

plandem commented Jul 15, 2017

If it's important, look for G14 at 3.2 sheet. I'm talking about these cells - lost their formatting after saving:
https://www.dropbox.com/s/4zwe4hwuxinwvav/Screenshot%202017-07-15%2023.35.41.png?dl=0

@xuri
Copy link
Member

xuri commented Jul 16, 2017

The cells that look different (no border style) are generated by the internal function completeCol(), it will preprocess to complete fill all the cells maybe used before set cell value, and these cell doesn't inherit the style of the surrounding cells, so it causing a display difference. I have fixed it by trim blank cells before save the file (this fix will have some impact on performance). I think the file size changes are caused by the compression algorithm, the content hasn't been affected.

@plandem
Copy link
Author

plandem commented Jul 16, 2017

@xuri do you mean that somewhere completeCol do something with cell that I didn't touch?!

P.S.: about performance - impact is not so high, at least for my case (about 10K rows)

@xuri
Copy link
Member

xuri commented Jul 16, 2017

Yes, the function completeCol() will auto complete in prepare range to fill cells.

@plandem
Copy link
Author

plandem commented Jul 16, 2017

I checked generated file - visually looks same! Huh....thanks man, I started to afraid that I did a bad choice to choose Go without testing saving ability of xls libs.

I will get feedback from end-user next week probably, maybe I miss something. Hope everything is fine now :)

@plandem
Copy link
Author

plandem commented Aug 2, 2017

I got another problem. After adding a new Sheet at that file I'm getting "Corrupted file" and sometimes Excel can't repair it.

@xuri
Copy link
Member

xuri commented Aug 2, 2017

Could you provide file attachments and more details?

@plandem
Copy link
Author

plandem commented Aug 2, 2017

I need to "prepare data". But at least one issue is:
steps:

  1. file was saved at osx Excel(2016 year)
  2. opened that file at osx Excel(2011) and he asks to fix corrupted file, after successful fix save it
  3. open at osx Excel(2016) - he asks to fix corrupted file.

Looks like there is something that break file :( Probably original issue was because of that.

@plandem
Copy link
Author

plandem commented Aug 3, 2017

Ok, looks like it has nothing with starter issue, so i'm closing it and will create a new one if required.

@plandem plandem closed this as completed Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants