Issue 10966

Title
Error opening report with Microsoft Excelwith long name
Priority
bug
Status
resolved
Nosy list
acaubet, ced, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

Created on 2021-11-19.13:14:22 by acaubet, last changed 1 month ago by roundup-bot.

Files

File name Uploaded Type Details
wdkLg47lMJM3Lhbu.png acaubet, 2021-11-19.13:14:22 image/png view

Messages

New changeset cdc0f24543d6 by Cédric Krier in branch 'default':
Limit report name to 100 chars
https://hg.tryton.org/tryton-env/rev/cdc0f24543d6
New changeset 5c0fae89ab48 by Cédric Krier in branch 'default':
Limit report name to 100 chars
https://hg.tryton.org/trytond/rev/5c0fae89ab48
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-10-22.10:08:02

Indeed we could expect that most of the time the path of report on Windows will be in the for C:\Users\<username>\AppData\Local\Temp\tryton_<random>\.
The username is most likely limited to 12 chars (from DOS) and the random which is 8 chars. Which makes it 56.
So this will bring the max name to 144 which can be rounded to 100 (just like we rounded the 255 to 200).

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-11-26.13:04:38

I do not know if it is possible to know that from the webbrowser.

Author: [hidden] (acaubet)
Date: 2021-11-26.12:34:21

remove the length for the temporary path where they will be stored.

IIUIC your solution it's only possible on Windows desktop client, not using sao as we can not know the temporary path. Am I right?

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-11-26.11:46:09

There is a possible improvement which will be that the client could set the upper limit for the filename of the report (in the context for example). This limit will be used instead of the default value if it is lower.
The client on windows will compute this limit by using the Microsoft limits and remove the length for the temporary path where they will be stored. If the computation result is 0 than the client will use the save popup instead of opening the file.
The best would be that this is only done if Microsoft software are used to open the file because I do not think libreoffice has such limit even on Windows.

Author: [hidden] (acaubet)
Date: 2021-11-26.11:36:04
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-11-25.16:15:08

There is no safe value as the problem is in Excel which has a limit on the fullpath.

Author: [hidden] (acaubet)
Date: 2021-11-25.15:53:49

We have found another client with the same problem.
I think the best option is to use a more save value, not so close to the limit as the actual.
A file of 175 chars as the first example provided is most of the time not relevant, because it's dificult to read.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-11-22.16:19:49

So it is a limitation of Microsoft Excel and as the path on which the client will save the report can have any length, for me we can not fix anything here. It is probably better to use a better software than Microsoft Excel.

Author: [hidden] (acaubet)
Date: 2021-11-22.15:56:30

I could be related with https://support.microsoft.com/en-us/topic/error-message-when-you-open-or-save-a-file-in-microsoft-excel-filename-is-not-valid-951229f3-dc14-980f-765e-224e4fdc7331
As they mention the max length (path + filename) must be less than 219 chars.
The initial issue filename have 229 chars.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-11-22.14:07:28

So we need to find why this OS does not support file name size of 200 which is really not that big (and lower than the common 255). An literature seems to suggest that the Windows limit is 260.

Author: [hidden] (acaubet)
Date: 2021-11-22.12:59:18

Does it work if it is smaller?
Yes, it works with REPORT_NAME_MAX_LENGTH = 100
Does other program can open it?
Not sure
Is the file format valid?
Yes, tested in other OS platforms.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-11-19.13:22:04

Does it work if it is smaller?
Does other program can open it?
Is the file format valid?

Author: [hidden] (acaubet)
Date: 2021-11-19.13:14:22

After applying the issue10946 the name of the file is reduced but I keep receiving the following error attached on Excel:
Not found "C:\Users\BETA6\AppData\Local\Temp\tryton_r4hf0om\Entradas-y-salidas-de-clientes-100u-CTWOAD35MRB-Placa-Bloqueada-CTWO-35-M-Derecha-B-Acero-100u-IGRSSTA35-Gradilla-para-alquiler-tornillos-corticales-autorroscantes-35-Acero__1.xlsx". Check grammar syntax and check that the location is correct.
Any ideas?

History
Date User Action Args
2022-10-26 23:26:48roundup-botsetmessages: + msg79305
2022-10-26 23:26:44roundup-botsetmessages: + msg79304
nosy: + roundup-bot
status: testing -> resolved
2022-10-22 10:27:52reviewbotsetmessages: + msg79255
nosy: + reviewbot
2022-10-22 10:15:19cedsetkeyword: + review
reviews: 421871004
status: in-progress -> testing
2022-10-22 10:08:02cedsetassignedto: ced
component: + trytond
messages: + msg79254
status: chatting -> in-progress
2022-02-05 10:09:10cedsettitle: Error opening report -> Error opening report with Microsoft Excelwith long name
2021-11-26 13:04:38cedsetmessages: + msg71877
2021-11-26 12:34:21acaubetsetmessages: + msg71875
2021-11-26 11:46:09cedsetmessages: + msg71872
2021-11-26 11:36:04acaubetsetmessages: + msg71871

Showing 10 items. Show all history (warning: this could be VERY long)