Bug 63570 - FILESAVE Writer does not evaluate formulas when converting to pdf or printing by command line
Summary: FILESAVE Writer does not evaluate formulas when converting to pdf or printing...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.1.2 release
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Commandline
  Show dependency treegraph
 
Reported: 2013-04-15 19:55 UTC by Milos Sramek
Modified: 2018-04-08 02:32 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Files demonstrating the problem (196.40 KB, application/x-gzip)
2013-04-15 19:55 UTC, Milos Sramek
Details
PDF of original ODT with expanded rows to better show the error message. (66.17 KB, application/pdf)
2013-07-17 00:33 UTC, Owen Genat (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Milos Sramek 2013-04-15 19:55:23 UTC
Created attachment 78015 [details]
Files demonstrating the problem

Hi,

Write does not evaluate formulas in odt files while converting to pdf or printing from command line.
Formulas are evaluated correctly when converting from docx and rtf files
Formulas are evaluated correctly when converting from odf by Apache OO 3.4

To reproduce:
Convert file tabulky2.LO40.odt to pdf by

libreoffice4.0 --headless --convert-to pdf tabulky2-LO40.odt

or print it by

libreoffice4.0 --headless --print-to-file xx.odt tabulky2-LO40.odt

Instead of the result an error message appears: "** Expression is faulty **" (in  the yellow field)

Try the same with the rtf and docx files - the result is correct

--
Milos
Comment 1 Owen Genat (retired) 2013-07-17 00:33:55 UTC
Created attachment 82514 [details]
PDF of original ODT with expanded rows to better show the error message.

This is just a confirmation of the problem with clarification. The problem only occurs for the ODT and not the DOCX or RTF (as the ODT contains formulas and the DOCX/RTF do not - they contain literal values). I can't confirm if AOO v3.4 converts the formulas in the ODT correctly, but if it does, then this may be a regression. In the ODT the initial 4-row Writer table includes these formulas in the last (red) row:

= sum<B2:B3>       # which displays "70"
= sum(<B4>)<C2:C3> # which displays "105"

The yellow table then references these two cells using the formulas:

= <Tabulka.B4>     # i.e., the "70" value above
= <Tabulka.C4>     # i.e., the "105" value above

I edited the original ODT by expanding the rows receiving the error in order to more clearly show the result. The attached PDF, generated from this edited ODT, clearly shows that the two cells in the red row result in "** Expression is faulty **", as do the two cells in the yellow row (which reference the two red cells). I have re-confirmed this by creating a new ODT containing only two simple tables: the first sums a cell containing "30" and a cell containing "40"; the second references the result of this sum formula. Resulting notation in ODT and output in the PDF are identical to the original files, thus I did not bother attaching them.

Tests conducted under GNU/Linux Crunchbang 11 running TDF/LO v4.0.4.2 (Build ID: 9e9821abd0ffdbc09cd8c52eaa574fa09eb08f2).
Comment 2 under_the_line 2014-07-25 07:00:49 UTC
Hi,

I'd like to push this bug report.
I ran into the same problem under windows and ubuntu.

Sum calculations endet up in "Faulty expression"-error.
If I calculate like "= <A1>+<A2><A3>" the result ist correct.

I also found out, that sum works if the table ist the very first element in the odt File.

Maybe, there is already a solution for this problem?

--
Chris
Comment 3 Owen Genat (retired) 2014-07-25 11:27:17 UTC
The problem of the formulas in the red row not totalling correctly (and not being referenced correctly in the yellow row) seems to be fixed in all these versions under GNU/Linux:

- v4.1.6.2 Build ID: 40ff705089295be5be0aae9b15123f687c05b0a
- v4.2.5.2 Build ID: 61cb170a04bb1f12e77c884eab9192be736ec5f5
- v4.3.0.3 Build ID: 08ebe52789a201dd7d38ef653ef7a48925e7f9f7
- v4.4.0.0.alpha0+ Build ID: 4aa9b041de3129f19b48e66d349f48657b73f33e (2014-07-19)

Milos if you can confirm this, we may be able to finally mark this bug as RESOLVED and WORKSFORME (unless an identifiable fix can be located, in which case it can be marked FIXED).
Comment 4 Milos Sramek 2014-07-26 14:39:51 UTC
(In reply to comment #3)
> The problem of the formulas in the red row not totalling correctly (and not
> being referenced correctly in the yellow row) seems to be fixed in all these
> versions under GNU/Linux:
> 
> - v4.1.6.2 Build ID: 40ff705089295be5be0aae9b15123f687c05b0a
> - v4.2.5.2 Build ID: 61cb170a04bb1f12e77c884eab9192be736ec5f5
> - v4.3.0.3 Build ID: 08ebe52789a201dd7d38ef653ef7a48925e7f9f7
> - v4.4.0.0.alpha0+ Build ID: 4aa9b041de3129f19b48e66d349f48657b73f33e
> (2014-07-19)
> 
> Milos if you can confirm this, we may be able to finally mark this bug as
> RESOLVED and WORKSFORME (unless an identifiable fix can be located, in which
> case it can be marked FIXED).

Hi,
it still does not work for me. I've tested
Verzia: 4.2.6.1  5fdddf655fba363e34f755715238d0943a44857e
Verzia: 4.3.0.3  08ebe52789a201dd7d38ef653ef7a48925e7f9f7

Did you run the conversion from command line? This way?
/opt/libreoffice4.2/program/soffice --headless --convert-to pdf t.odt
--
m
Comment 5 Owen Genat (retired) 2014-07-28 05:18:48 UTC
(In reply to comment #4)
> Did you run the conversion from command line? 

Oh, sorry. Please disregard comment 3. Still produces the indicated error here also.
Comment 6 under_the_line 2014-07-28 09:19:51 UTC
Hi,

I've tested with
4.2.5.2 (WIN)
4.2.4.2(Ubuntu 14.04)


PHP
$msg = @shell_exec($cmd_prefix.escapeshellarg($libreoffice_path).' --headless --nodefault --nofirststartwizard --nolockcheck --nologo --norestore --invisible --convert-to pdf '.escapeshellarg($path).' --outdir '.escapeshellarg($temp_file_dir));

Command Line

soffice.exe --headless --nodefault --nofirststartwizard --nolockcheck --nologo --norestore --invisible --convert-to pdf test.pdf --outdir test;

/usr/bin/libreoffice --headless --nodefault --nofirststartwizard --nolockcheck --nologo --norestore --invisible --convert-to pdf /home/xxx/test.pdf --outdir /home/xxx/temp

--
Chris
Comment 7 QA Administrators 2015-09-04 02:48:16 UTC Comment hidden (obsolete)
Comment 8 Buovjaga 2015-11-18 12:04:49 UTC
Still repro.

Ubuntu 15.10 64-bit 
Version: 5.1.0.0.alpha1+
Build ID: 7272e8df62a12d6172b297d7a82a0265cd1bc44a
TinderBox: Linux-rpm_deb-x86_64@70-TDF-dbg, Branch:master, Time: 2015-11-15_00:23:07
Locale: en-US (en_US.UTF-8)
Comment 9 Jens Haeuser 2016-11-02 21:06:00 UTC
same error here, trying to convert 10+ odt writer documents incl. a table and some formulars. Everytime I convert the files to PDF using the commandline, the formulars are not evaluated before converting and in the output file you see "expression is faulty" instead of the value.
Comment 10 tommi 2017-04-07 19:15:04 UTC
I can confirm this bug using also .fods format and converting to pdf
Comment 11 QA Administrators 2018-04-08 02:32:47 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug