[Qgis-user] Filter in field group sections of report

Yann Voté ygversil at lilo.org
Mon Oct 11 05:33:06 PDT 2021


Hi Jésahel,

Thanks for your reply. Your proposed solution would be fine if it was 
just me. What I forgot to say is the purpose: I want to share the QGIS 
project with other users who have limited QGIS skills.

A user story would be: the user opens the QGIS project, selects the 
polygon layer A, selects the Generate Report action from the action 
menu, clicks on the desired polygon, and the PDF report for the clicked 
polygon gets generated.

Or something similar with a processing algorithm.

I think I found a workaround by using an atlas instead of a report. An 
atlas is OK for this particular case: main polygon layer A related with 
a non-geometric layer B whose data can be displayed within an Attribute 
Table item. Contrary to a report, an atlas output can be filtered with 
the `is_selected()` expression.

I will continue to explore this path and let everyone know the found 
solution in the forum thread when I'm done.

But I still believe that, for more complex use cases, namely maps in 
sections and related maps in subsections, which require a report, a 
filter option would be extremely useful.

Regards.

Yann


Le 10/10/2021 à 23:20, Jésahel Benoist a écrit :
> Hi Yann,
> 
> As I'm often using reports based on filtered datas, and as I see that 
> you know how to filter, I don't really understand what is the problem. 
> You can just apply a filter in the main ui on the a or b layer, or make 
> virtual layers with only the needed datas. Then use the report (close 
> when a change is made in the main ui).
> 
> Regards,
> 
> Jésahel
> 
> Le dim. 10 oct. 2021 à 18:53, Yann Voté <ygversil at lilo.org 
> <mailto:ygversil at lilo.org>> a écrit :
> 
>     Hi everyone,
> 
>     Let's imagine we have a polygon layer named Layer A with tons of
>     features (tens of thousands), and an attribute layer named Layer B with
>     even more features. Each polygon in Layer A is associated with one or
>     more rows in Layer B.
> 
>     Now suppose we have created a report with a top section for Layer A
>     containing a map centered at each polygon, and a subsection for Layer B
>     showing attributes for each related B row.
> 
>     Is there a way to output the report for exactly one polygon in layer A,
>     or for only some polygons (for example selected polygons) ?
> 
>     And is there a way in the subsection to output only some of the related
>     rows based on some filter expression ?
> 
>     I am aware of this feature request
> 
>     https://github.com/qgis/QGIS/issues/44821
>     <https://github.com/qgis/QGIS/issues/44821>
> 
>     but is there a way to achieve this with more steps in the UI or with
>     pyQGIS ?
> 
>     Thanks a lot !
> 
>     Regards.
> 
>     -- 
>     Yann Voté - ygversil at lilo.org <mailto:ygversil at lilo.org>
>     _______________________________________________
>     Qgis-user mailing list
>     Qgis-user at lists.osgeo.org <mailto:Qgis-user at lists.osgeo.org>
>     List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>     <https://lists.osgeo.org/mailman/listinfo/qgis-user>
>     Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>     <https://lists.osgeo.org/mailman/listinfo/qgis-user>
> 


More information about the Qgis-user mailing list