Bug 148170 - Calc: setting print range with the whole column not remember in XLS/X
Summary: Calc: setting print range with the whole column not remember in XLS/X
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Andreas Heinisch
URL:
Whiteboard: target:24.8.0
Keywords: filter:xls, filter:xlsx
: 156810 (view as bug list)
Depends on:
Blocks: Print-Range
  Show dependency treegraph
 
Reported: 2022-03-25 07:39 UTC by pornchai_kuk
Modified: 2024-03-18 08:54 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
This is the file I used and found this bug. (12.00 KB, application/octet-stream)
2022-03-30 14:01 UTC, pornchai_kuk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pornchai_kuk 2022-03-25 07:39:29 UTC
Description:
I have set print rage.
After I close and reopen same file next time, the setting print rage is gone. I have to do it again.

Steps to Reproduce:
1.Open file
2.Select print rage 
3.Set print rage (Format - Print Ranges - Edit - selection)
4.Print preview
5.Close the file
6.Redo 1 and 4, the setting print range is cleared.

Actual Results:
The setting print range in last time is cleared.

Expected Results:
The setting pritn range should be saved in file for next print.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.2.5.2 (x64) / LibreOffice Community
Build ID: 499f9727c189e6ef3471021d6132d4c694f357e5
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 1 Timur 2022-03-25 11:28:55 UTC
I don't reproduce. Do you reproduce in any file or just some, which file type?
Or you maybe have filtered rows there?
Comment 2 pornchai_kuk 2022-03-26 02:04:37 UTC
I found this when I'm working with my xls file. 
I created this file with Calc and save as xls format.

And I have set filter to some column in the sheet I do print, but I show all data for that column when print.

I tried set print rage to other sheet (sheet B) in same file but no filter, then I previewed to check the setting. I closed and reopened the file with sheet B and check with print preview, the setting pring range is reset.
Comment 3 Timur 2022-03-28 14:31:52 UTC
Also no repro for xls. Either there's some detail more or it's about your xls.
Try creating new XLS for test. If no problem there, attach your XLS with test data.
Comment 4 pornchai_kuk 2022-03-30 14:01:07 UTC
Created attachment 179213 [details]
This is the file I used and found this bug.

I'm not sure this bug is only with this xls file or other xls file also.

I also screen record when I tested, please see from
https://youtu.be/yD2xD4GUOu4
Comment 5 pornchai_kuk 2022-03-30 14:01:36 UTC Comment hidden (obsolete)
Comment 6 Timur 2022-03-30 14:53:27 UTC
I confirm now with XLS and XLSX not ODS, only if print range is the whole column. 
Repro 7.4+ and 4.1 and OO. Seems Inherited.
Comment 7 m_a_riosv 2023-08-18 14:53:11 UTC
*** Bug 156810 has been marked as a duplicate of this bug. ***
Comment 8 Andreas Heinisch 2024-02-29 20:58:41 UTC
.xls supports up to 65,536 rows and if you select an entire col calc tries to export 1,048,576 rows for its print range. 

Two possible solutions, warn the user that such a print range cannot be exported and/or shrink the print range to 65,536 which may still create some problems. Thoughts?
Comment 9 Andreas Heinisch 2024-03-04 23:24:34 UTC
So I checked the implementation and the only way to solve this is to change the address of the form $A$1:$A$1048576 to the form $Sheet1.$A:$A

This can be done using the ScCompiler for the print range dialog. However, under print ranges -> define it already selects the correct range without the ScCompiler. Hence, the compiler doesn't reduce the address to the form $Sheet1.$A:$A. 

I could not find the other way round (creating a reduced ScRange).
Comment 10 Commit Notification 2024-03-13 08:29:18 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2d472fae8f1223dc969172951d08ff6e4b4f98ba

tdf#148170 - Convert print range to an excel cell range

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.