Bug 158533 - Incorrectly export number 0 form calc to PDF
Summary: Incorrectly export number 0 form calc to PDF
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.4.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks:
 
Reported: 2023-12-05 08:13 UTC by Jaroslaw
Modified: 2024-01-17 18:39 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
One of file witch wrong export to PDF (26.96 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-12-05 11:18 UTC, Jaroslaw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslaw 2023-12-05 08:13:07 UTC
Description:
When I export CALC sheet with fields filed 0 as number (field set as numeric), this fields on PDF show as empty - not show "0".
Problem at least at LibreOffice 7.4 series (mayby elier).
It's a serious problem, because 0 and empty field not show the same information.

Check on at least 3 different computers and user profiles - 2x Windows 11 Pro, 1x Windows 10 Pro.

When field with numer zero set as "text" - exported PDF show this correctly, but isn't solution.

Steps to Reproduce:
Both path was equal:
1a. Export to PDF
1b. Export => "Save as": PDF


Actual Results:
CALC field shows "0" (field set as numieric - default) => PDF show empty field

Expected Results:
CALC field shows "0" (field set as numieric - default) => PDF field shows "0"


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.1.2 (X86_64) / LibreOffice Community
Build ID: f5defcebd022c5bc36bbb79be232cb6926d8f674
CPU threads: 8; OS: Windows 10.0 Build 22000; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: pl-PL
Calc: threaded

System shows:
System: Windows 11 Pro
Version: 21H2
Compilation: 22000.2538
 with all critical or nessesery update.
Comment 1 m_a_riosv 2023-12-05 10:48:31 UTC
Please attach a sample file.
Comment 2 Jaroslaw 2023-12-05 11:18:43 UTC
Created attachment 191243 [details]
One of file witch wrong export to PDF

Part of field of every sheet was protect to edit. All sheet protect to edit.
Sumarize each column on single sheet and conditional format this results to show posiible wrong write data.
Export do PDF with option:
- PDF/A ISO 19005: version PDF/A-3b
- PDF/UA
Comment 3 Jaroslaw 2023-12-05 11:40:58 UTC
I think i see what is wrong.
One of options from "Print preview" => "Page formating" used to export PDF:
page "sheet" => "zero values"

In my humble opinion when we export sheet to PDF value "0" must be exported as "0" not empty field, aspecialy when generated PDF/A (archive).

I search for some options to PDF in:
- "Tools" => "Options" => "LibreOffice"
- "Tools" => "Options" => "Calc"
Comment 4 Kira Tubo 2023-12-12 05:43:57 UTC
I guess the question is whether or not we want the exported PDF to display "0" values using the "Zero values" settings from "Print preview" or "Tools" section. I can understand from the user's perspective that it would be pretty easy to assume that the "Zero values" setting from "Print preview" should only controls documents that are physically printed. Maybe something for the UX team to review?
Comment 5 Heiko Tietze 2023-12-12 14:08:49 UTC
Weird option, probably there for compatibility. Feels wrong to ignore this settings on export to PDF (or anything else). And, by default the option is checked.
Comment 6 Kira Tubo 2023-12-21 02:14:52 UTC
(In reply to Heiko Tietze from comment #5)
> Weird option, probably there for compatibility. Feels wrong to ignore this
> settings on export to PDF (or anything else). And, by default the option is
> checked.

If we are keeping things as is, then probably the next best thing is to update the documentation to clarify how the settings affect the exported PDFs. 

Add info that settings under Format - Page Style - Sheet affects exported PDF: 
https://help.libreoffice.org/latest/en-US/text/scalc/guide/print_details.html?DbPAR=CALC#bm_id3154346

Clarify that settings under Tools - Options - LibreOffice Calc - View has NO effect on exported PDF:
https://help.libreoffice.org/latest/en-US/text/shared/optionen/01060100.html?DbPAR=SHARED#bm_id3147242
Comment 7 Heiko Tietze 2023-12-21 09:01:51 UTC
We discussed the topic in the design meeting.

The default is to export zeros and if a user deliberately switches the option off we should respect this. Excel behaves exactly the same.

Whether some PDF formats should be treated more carefully is a question to the experts.
Comment 8 Buovjaga 2024-01-17 17:30:09 UTC
Removing keyword needsDevEval, which is used for potential easy hacks: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Keywords#needsDevEval