-
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
Xls Writer Cannot Parse TRUE When Supplied as a Function Argument #3369
Comments
oleibman
added a commit
to oleibman/PhpSpreadsheet
that referenced
this issue
Feb 16, 2023
PR PHPOffice#3340 increased coverage in Reader Xls for most functions. Some of the omissions from that PR (see below) were intended from the start. However, the set of (BINOMDIST, EXPONDIST, GAMMADIST, NORMDIST, POISSON, WEIBULL, and FIXED) were not intended to be omitted; they just did not seem to work. Having had time to research, it appears that the problem is not those functions themselves, but rather the use of Boolean constants as function arguments (see issue PHPOffice#3369). Knowing that, it is possible to add those missing functions back in, just taking care to use `0` or `1` or `TRUE()` or `FALSE()` rather than boolean constants as arguments. No update to source or test code; just adding a few new cells to an Xls spreadsheet. Functions still omitted because they return array results: - GROWTH - LINEST - LOGEST - MINVERSE - MMULT - TRANSPOSE - TREND Functions still omitted because they are not implemented in PhpSpreadsheet: - BAHTTEXT - CELL - FREQUENCY - GETPIVOTDATA
11 tasks
oleibman
added a commit
that referenced
this issue
Feb 16, 2023
PR #3340 increased coverage in Reader Xls for most functions. Some of the omissions from that PR (see below) were intended from the start. However, the set of (BINOMDIST, EXPONDIST, GAMMADIST, NORMDIST, POISSON, WEIBULL, and FIXED) were not intended to be omitted; they just did not seem to work. Having had time to research, it appears that the problem is not those functions themselves, but rather the use of Boolean constants as function arguments (see issue #3369). Knowing that, it is possible to add those missing functions back in, just taking care to use `0` or `1` or `TRUE()` or `FALSE()` rather than boolean constants as arguments. No update to source or test code; just adding a few new cells to an Xls spreadsheet. Functions still omitted because they return array results: - GROWTH - LINEST - LOGEST - MINVERSE - MMULT - TRANSPOSE - TREND Functions still omitted because they are not implemented in PhpSpreadsheet: - BAHTTEXT - CELL - FREQUENCY - GETPIVOTDATA
oleibman
added a commit
to oleibman/PhpSpreadsheet
that referenced
this issue
Feb 22, 2023
Fix PHPOffice#3369. The parser had failed to account for `TRUE` and `FALSE` when supplied as arguments to a function. I had hoped to be able to do something about its inability to handle defined names as well. I failed. I think another section might need to be added to the Writer output which specifies the defined names. I haven't yet located any suitable documentation.
11 tasks
oleibman
added a commit
that referenced
this issue
Feb 23, 2023
Fix #3369. The parser had failed to account for `TRUE` and `FALSE` when supplied as arguments to a function. I had hoped to be able to do something about its inability to handle defined names as well. I failed. I think another section might need to be added to the Writer output which specifies the defined names. I haven't yet located any suitable documentation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is:
What is the expected behavior?
A function argument of TRUE (and presumably FALSE) can be parsed by the Xls Writer so that the formula is reproduced faithfully when the spreadsheet is saved as Xls.
What is the current behavior?
Parser throws an Exception at the end of function
fact
. The writer still writes the cell, but with its calculated value rather than its formula. I can see that another regexp or two needs to be tested for this, but I have not yet figured out what should happen if the new regexes are matched. Note that TRUE is parsed correctly as just a cell value (cell A1), and that theTRUE()
function is parsed correctly when supplied as an argument (cell A4). However, both cells A2 (TRUE is first argument) and A3 (TRUE is last argument) are written out as a value rather than a formula.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:
If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Only Xls is affected.
Which versions of PhpSpreadsheet and PHP are affected?
All.
The text was updated successfully, but these errors were encountered: