Bug 152743 - Table elements not accessible in field formulas and text field formulas not available in table cells
Summary: Table elements not accessible in field formulas and text field formulas not a...
Status: RESOLVED DUPLICATE of bug 101303
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.7.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-30 21:59 UTC by David Alden
Modified: 2023-07-20 09:51 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Writer Doc with formula deficiency example (12.04 KB, application/vnd.oasis.opendocument.text)
2022-12-30 22:02 UTC, David Alden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Alden 2022-12-30 21:59:40 UTC
Description:
Writer 7.3.7.2 build e114eadc50a9ff8d8c8a0567d6da8f454beeb84f; text page with two tables.  When I attempt to include a table cell <Table2.D7>*25 in a text field calculation the result is "** Expression is faulty **" in gray.  If I put the table cell value in the Formula instead (e.g., .032*25) it shows up correctly.  If I copy and paste the document text line with the Formula field into a table cell (e.g., A11), the text field value is not accessible for calculations in another table cell (e.g., C11) example: <A11>*<C10> the result is "0.00" rather than the correct calculated value.  It would seem that LibreOffice Writer should allow table values to be used in text field Formulas in the same document and recognize those Formula fields embedded in table cell text for use in other table cell computations.

Steps to Reproduce:
1.In Writer document Insert new table with two rows and three columns.
2.Populate table column two with non-zero numerical values.
3.Below table enter text "Test text field _ value." and attempt to insert Formula field with '<Table1.B1>*4*4' where '_' is shown. Note: "faulty" mesg.
4.Right click on text formula field and edit text field formula "<Table1.B1> replacing with value entered in table cell B1. Note: correct gray value. 
5.Highlight and copy (Ctrl-C) entire text line below table and paste (Ctrl-V) in table cell A2. Note: text shown with gray formula field in table cell.
6.Click on table cell C2 and press F2.  Enter formula "=<A2>*<B2>" and press enter. Note: value in table cell C2 is zero instead of calculated value.


Actual Results:
See above; "** Expression is faulty **" instead of table cell value calculation.
See above; Table cell "0" instead of correct calculated value.

Expected Results:
Calculated table cell <Table1.B1>*4*4 in gray text formula field.
Calculated text formula field using table cells as selected.


Reproducible: Always


User Profile Reset: No

Additional Info:
Documentation implies table cells can be included in Formulas if enclosed in angle brackets <>.  Can provide TableDoc.odt as attachment.  Recognition of table cells in text formula fields and visa versa would significantly improve the usefulness of this feature.
Comment 1 David Alden 2022-12-30 22:02:26 UTC
Created attachment 184404 [details]
Writer Doc with formula deficiency example
Comment 2 Dieter 2023-01-16 07:04:08 UTC
(In reply to David Alden from comment #0)

> Additional Info:
> Documentation implies table cells can be included in Formulas if enclosed in
> angle brackets <>.  Can provide TableDoc.odt as attachment.  Recognition of
> table cells in text formula fields and visa versa would significantly
> improve the usefulness of this feature.

I also couldn't find a way to solve the problem. But I also couldn't find any information in LO Help [1]. Where have you found it?
Comment 3 Dieter 2023-02-05 10:32:23 UTC
Answer from David in private email:

"Hi LO Support, Thanks for following up.  I have found 'LO Help' rather un-helpful when it comes to the details of particular features in Writer and that is especially true for tables and field formulas.  Most of the capabilities are not documented at all and the examples are inadequate.  I ended up performing a number of google searches on specific features e.g., "LibreOffice Writer Formulas", "LibreOffice Writer Formula max",  etc. and found some more helpful material on other sites: stackoverflow.com, techrepublic.com, youtube.com, howtogeek.com, etc., and even ask.libreoffice.org.  This enhancement request also implies an enhancement to the documentation along with the implementation.  This enhancement request would permit table and field formulas to update consistently throughout a document by changing just a single value in either a table cell or a field.

Generally speaking, I have found the LO Writer table and field formula capability rather poorly implemented, particularly when it comes to parsing order of operations.  I have since found another example that I plan to document in another bug report."
Comment 4 Dieter 2023-02-05 11:02:06 UTC
Steps

1. Open attachment 184404 [details]
2. Try to change formula in fields in a way, that it gives a valid result

Actual result
Not possible

Expected result
Should be possible.

Not sure, if it is a bug, an enhancement request, or - if there is a principle limitation of such a feature - an documentation issue. Help [1] doesn't provide any informations here. Writer guide says: "Other uses of fields, including database fields, are described in various chapters of this book. LibreOffice provides many other fields that you may find useful, but they are too specialized to cover in this book. Please refer to the Help system for details, instructions, and examples." (Writer Guide 7.3, page 398) Not helpful at all.

So I change status to new and add design-team for a decision.

At least related to bug 72096

[1] https://help.libreoffice.org/7.5/en-GB/text/swriter/01/04090005.html?System=WIN&DbPAR=WRITER&HID=modules/swriter/ui/fldvarpage/FieldVarPage#bm_@@nowidget@@
Comment 5 Stéphane Guillou (stragu) 2023-07-20 09:51:34 UTC
Duplicate of earlier enhancement request to use table references in formulas outside of tables: bug 101303

*** This bug has been marked as a duplicate of bug 101303 ***