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

Problem with cross sheets formula, am I doing it wrong ? #56

Open
Gniarf opened this issue Dec 21, 2022 · 5 comments
Open

Problem with cross sheets formula, am I doing it wrong ? #56

Gniarf opened this issue Dec 21, 2022 · 5 comments
Labels

Comments

@Gniarf
Copy link

Gniarf commented Dec 21, 2022

Hello

first, let me thanks for this project, I have been searching for something equivalent in .net and have given up so I am coding in Java with yours, it's easy to use and efficient.

I am running into a strange problem.
If I define a formula that does a very simple sum with data from the same sheet, it works properly.
If I define exactly the same formula but taking the data from another sheet, it just does not compute the result.

Sheet sheet = spread.getSheet("Operations"); Range range = sheet.getRange("C2"); range.setValue(13.42); sheet.getRange("C3").setValue(42.65); sheet.getRange("E3").setFormula("SUM(C:C)"); // works fine spread.getSheet("Calculs").getRange("B1").setFormula("SUM(Operations!C:C)"); // the sum is not computed

here is the formula in the generated file : =SUM(operations C:C) instead of =SUM(operations!C:C)
note the missing !

I have tried different ways to write it, the result is always the same : the result is not computed. I can still open the file and rewrite the ! and it will do the job, but I need automation.

Am I doing something wrong ?

Thank you

@github-actions
Copy link

Thanks for your report! Please ensure you have provided enough info in order to recreate the issue, including the problematic ODS File.

@miachm
Copy link
Owner

miachm commented Dec 23, 2022

It seems like a legit error. Not sure why it's removing the (!). It must be something related to the XML file. But it should not happen since (!) is a valid character.

@miachm miachm added the bug label Feb 16, 2023
@miachm
Copy link
Owner

miachm commented Apr 10, 2023

Is this fixed in the latest version? I have tried to generate a file with this symbol and worked fine

@Gniarf
Copy link
Author

Gniarf commented Apr 11, 2023

With the 1.5.4 here's the result :

sheet.getRange(cellId).setFormula("=Type_Operations!$C$1")

And here is what I find the produced ods : =type_operations $C$1

So it's not good :(

@miachm
Copy link
Owner

miachm commented Apr 13, 2023

Tested the same string and works with LibreOffice 7.5.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants