1

The gift of Reports in QGIS is a massive step in the right direction. I have set up a department template for my team to use and it looks great!

Right now, I am attempting to setup a report that will output one route at a time (I am a transport planner) to allow us to visually inspect how the routes were programmed into the network model. To do this, I used the old method that you could use for atlases by setting up a symbology style that would only show the current atlas feature:

$id = @atlas_featureid

This works great for the first section of the report. Unfortunately, the second section not so much. In the second section, the title matches the zoom (the title gives the route number and description) but the line visible is the wrong route. Is there any reason using the above expression wouldn't also work for reports with multiple sections?

I also tried I also tried "Route" = Attribute( @atlas_feature , 'Route') to see if that would fix it. I had the same problem.

Bonus: I also tried intersects( $geometry , @atlas_geometry ) and now I'm beginning to think this is a bug. See update below.

Update: I have noticed that the layer from Group 1 is still showing even though a different layer is selected for group two (as shown in the pictures below). The setup for Section 2 is provided in the screenshot below, however.

Report Layout Setup for Section 2

  • Some more info is required - can you include screenshots or your current report setup and samples of attribute data? – ndawson Mar 17 at 20:08
  • I have included the report setup for Section 2 (the failed section) but because the content is in draft form and is not yet approved for public issue, I can't really show much else. – MowgliB Mar 17 at 20:34
0

The problem arose due to thinking that selecting the layer to iterate over would also be the one that was visible throughout the printing process. However, because there is no preview of pages in Report mode yet, it makes it impossible to actually see what's going on as it renders each page.

If, like me, you need to only have one layer on at a time, you will need to create a report preset for each section of the report.

Create preset

Following this, as you create your report body for each section, you will need to assign that preset to each map of each section manually.

Select map preset

Now, I used "Route" = Attribute( @atlas_feature , 'Route') but I imagine using $id = @atlas_featureid would also work as the rule in the symbology for each of your data layers. Important to note the ELSE that's there as well. I think that is required to make sure it knows there are things to print. I just set it to a fully transparent line.

Add style rule

Now you will be able to create a whole report with a single feature on each page of each layer in individual sections.

Sometimes you just have to remember that QGIS is actually quite a "dumb" program. But being that way makes it so much more flexible, so you've gotta take the slightly longer workflows with the good.

  • I'm lost : did u want one feature by report (or section) or one layer by report (or section) ? And : are you sure @atlas_featureid or @atlas_feature are available while using reports (that would be unexpected ...) – snaileater Mar 20 at 12:30
  • Report sections that are set to field group are designed to iterate across each feature of the layer; i.e. they are synonymous with atlases. When you output your report, you're effectively outputting several atlases joined together and that's how QGIS treats them. My solution above would not have worked were it not for this fact. – MowgliB Mar 21 at 0:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.