Closed twnaing closed 5 years ago
Can you provide a failing test? I.e. piece of code, which does not behave the way you would like?
@gorn, thank you for quick response.
Frankly, I do not have test. I am just doing manual testing.
I updated the issue post with screenshots.
I do not need any sofisticated test. I just need to reproduce the error to be able to correct it.
When I run the following code
require 'rspreadsheet'
file = Rspreadsheet.new
sheet = file.create_worksheet
sheet.cell(1,1).value = 'A'
sheet.cell(1,1).format.background_color = '#EEEEEE'
file.save('test.ods')
It saves correct document with gray background of cell A1. Can you alter the code so it fails? Or post the file which causes the failure + the code?
@gorn, sorry, I want to apologize you for wasting your time.
I opened ods file converted form xlsx and tried to do the operation. I found out that the ods file has lot of errors. (I tested it with jing
according to this page)
ods file converted using the following software/service has the problem discussed in this issue
At least, I could advise other users not to use ods file converted from other file format.
Thank you for your time and your wonderful gem.
You are welcomed, BTW the easiest way to convert is to install LibreOffice. Cals is also superior to Microsoft Spreadsheet tool.
@gorn, I did convert using LibreOffice. Even with LibreOffice, I still experiencing background color bleeding to other unintended cells. I am still testing and couldn't pinpoint the cause.
The worksheet needs to have
I will report back here if I found specific feature causing the background-color bleeding.
It would be helpful if you are able to isolate reproducible case. I.e. something that fails everytime. Reopen the issue than.
@twnaing even if you do not isolate the problem, it is sufficient for me to have any reproducible failing case. Even complicated one, but it should be reproducible on my side, as a first step to correct it.
@gorn,
When I changed the background color of the cell (I wanted) the cells (I do not wanted) are also changed if they have the same format. It is not specific to feature.
example 1: if A1 and C10 are bordered in LibreOffice, they will have same background color if I change the background color of A1 by opening the file and saving the file again with rspreadsheet.
Not related to this one, if I 'clear direct formatting' the cell in LibreOffice, rspreadsheet gives error with something like 'no style node'.
I am testing with rspreadsheet 0.4.5, LibreOffice 6.0.5.2 on Mac and the ods file is ODF schema version 1.2
That has some logic ... I will try to prepare the file with which it fails
Submitted failing test, see also https://travis-ci.org/gorn/rspreadsheet/builds/537741387
@twnaing: I have found and corrected the bug. There is a new release ver 0.4.8 for that. Can you upgrade and test it on your side?
@gorn, confirmed. It is working as expected with gem version 0.4.8
.
I am trying to set background color using the following code.
Please see the below screenshot to see the column I want to colorize
col
androw
are generated in nested loop. The following code correctly set the cell with value 'S' (so the col and row calculation is correct)I have tried accessing the cells with various methods and rspreadsheet consistently (not random) mis-colorize the background-color of (unintended) cells.
Have anyone experience this problem? Any direction to fix this is much appreciated.