-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Images, formulas and checkboxes disappear #4280
Comments
I have downloaded your spreadsheet, but don't understand what problems you are having.
Even given the answers to the questions above, this spreadsheet may be too complicated for me to debug. Might you be able to simplify it at all? |
The "value rather than formula" problem indicates we may not be handling "shared formulae" correctly. Here's what the xml has to say: <c r="C14" t="b">
<f>IF(B14="oui",TRUE,FALSE)</f>
<v>0</v>
</c>
...
<c r="C15" t="b">
<f t="shared" si="0"/>
<v>0</v>
</c> C15 is apparently using a "shared formula" derived from C14, but I don't see anything in C14 to suggest that it is a shared formula. I will need to research. |
The following xml lines may be relevant, in particular the line with <c r="C10" t="b">
<f>IF(B10="oui",TRUE,FALSE)</f>
<v>0</v>
</c>
...
<c r="C11" t="b">
<f t="shared" ref="C11:C16" si="0">IF(B11="oui",TRUE,FALSE)</f>
<v>0</v>
</c> |
Shared formulae work correctly on a much simpler spreadsheet. Whatever the problem is here, it seems specific to the more complicated spreadsheet. |
The problem seems to be the handling of shared formulae with a boolean result. Expect a fix for that problem in a day or two. I still need more information about the other problems. |
I believe the missing pictures (e.g. B8 on sheet Acceuil) are placed in the cells rather than over them. This is a very recent addition to Excel and we do not yet support it, which is why they are not found in the copy. Still need more information about missing checkboxes. |
A solution, at least in part, for issue PHPOffice#4280. Xlsx Reader is not handling shared formulae correctly. As a result, some cells are treated as if they contain boolean values rather than formulae.
Can you download your spreadsheet with sheet protection off, at least on the worksheet you want me to look at? Or, if you prefer, let me know the password to unprotect it. |
Sorry for the delay, here is the document without the password |
Thank you for the sample. I see what the problem is. The documentation about it is pretty sparse, so I don't know what, if anything, I can do about it. For now, I'm just going to have to document what I've found. Your spreadsheet contains a file xl/featurePropertyBag/featurePropertyBag.xml. This describes the checkbox, and may or may not be the same for all spreadsheets which use checkboxes in this manner, i.e. by selecting "Checkbox" on the "Insert tab". It appears to be available only for Excel 365. PhpSpreadsheet knows nothing about this file, ignoring it on read and not writing it on output. The style for a cell which uses a checkbox in this manner appears like: <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0">
<extLst>
<ext uri="{C7286773-470A-42A8-94C5-96B5CB345126}" xmlns:xfpb="http://schemas.microsoft.com/office/spreadsheetml/2022/featurepropertybag">
<xfpb:xfComplement i="0"/>
</ext>
</extLst>
</xf> The first line there is "normal" styling for the cell. The extlst portion is what appears to implement the checkbox. PhpSpreadsheet knows nothing about this, ignoring extlst on read and not generating it on write. So, a solution, if any, for this particular problem would be to:
This seems like it could be a lot of work. It won't happen any time soon. I will leave this ticket open in the meantime. |
Ok thank you for the feedback, let me know when the problem is solved |
Hi, any feedback on this issue ? |
It's on my to-do list, but there is much ahead of it. Sorry. |
This is:
What is the current behavior?
Images (sheet "Accueil"), formulas (sheet "Data" cell C15) and checkboxes (sheet "Renovez votre maison) disappear after IOFactory::createWriter and save
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
The text was updated successfully, but these errors were encountered: