Bug report #21010

Layout Manager Atlas Output filename expression is not working anymore

Added by Raul Sangonzalo over 1 year ago. Updated over 1 year ago.

Status:Closed
Priority:High
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:3.4.3 Regression?:Yes
Operating System: Easy fix?:Yes
Pull Request or Patch supplied:No Resolution:no timely feedback
Crashes QGIS or corrupts data:No Copied to github as #:28829

Description

The output filename expression (in Atlas Generation) is not translating correctly the inserted text to the Windows Dialog when exporting the map. Even if you use the variable "@project_path" the output string gets corrupted, transforming the \ into _.

We have used this feature in QGIS 2.18, as we use different layouts to different products and it has been working well most of the time (although sometimes the code wasn't being refreshed and got stuck in the previous value)

expressionissue.png (15.5 KB) Raul Sangonzalo, 2019-01-16 11:28 AM

code issue.PNG (11.5 KB) Raul Sangonzalo, 2019-01-22 03:08 PM

History

#1 Updated by Raul Sangonzalo over 1 year ago

Raul Sangonzalo wrote:

The output filename expression (in Atlas Generation) is not translating correctly the inserted text to the Windows Dialog when exporting the map. Even if you use the variable "@project_path" the output string gets corrupted, transforming the \ into _.

We have used this feature in QGIS 2.18, as we use different layouts to different products and it has been working well most of the time (although sometimes the code wasn't being refreshed and got stuck in the previous value)

I think I have found the issue in the code. In qgslayoutatlas.cpp, in line 347. I believe that what is happening is that the entire path is converted into a QFileInfo fileName() somehow (I'm sorry, my knowledge in C++ is very limited) so my understanding is that because a file cannot contain a "\" in the name, it is converted to a "_" in the dialog.

My conclusion is that this might not be a bug after all, and that now it is working as it is supposed to be (I might be wrong though). I think in QGIS 2.18, it did what it wasn't supposed to and miraculously served our purpose, which was to find the correct folder (constructed with an expression) and adding the feature name to the file automatically, so perhaps this post might have to be changed to "Feature Request".

Best,
Raúl

#2 Updated by Giovanni Manghi over 1 year ago

  • Status changed from Open to Feedback

My conclusion is that this might not be a bug after all, and that now it is working as it is supposed to be (I might be wrong though). I think in QGIS 2.18, it did what it wasn't supposed to and miraculously served our purpose, which was to find the correct folder (constructed with an expression) and adding the feature name to the file automatically, so perhaps this post might have to be changed to "Feature Request".

closing?

#3 Updated by Giovanni Manghi over 1 year ago

  • Resolution set to no timely feedback
  • Status changed from Feedback to Closed

Also available in: Atom PDF