<div dir="auto">Hello Yann, <div dir="auto"><br></div><div dir="auto">You can do it programmatically with python and a custom toolbar. </div><div dir="auto"><br></div><div dir="auto">But, I had a similar problem and happily, qgis as a multipurpose tool is widely accepted by average users and filtering can be easily explained.<div dir="auto"><br><div dir="auto">In fact my problem was worst, I have tens of layers. I created two layers, one with geometric feature, one linked to the previous with (let say) temporal features, and finally a virtual one linking the two previous for special purposes. All others layers are linked to the temporal one. I created and shared the multiple layers tools toolbar that permits to filter a set of layers based on the first in the list (which is the temporal). So when I click on the multiple filter button, all layers are filtered, and only the specific needed items are drawn and used for printing.</div><div dir="auto"><br></div><div dir="auto">Explaining the filter button tooks me 5 minutes, really, even to the most allergic to computers person I know. Of course readable fields names and readable values helps a lot !</div><div dir="auto"><br></div><div dir="auto">I can give you some later code for a custom toolbar with automatic filtering that I created to speed things.</div><div dir="auto"><br></div><div dir="auto">Regards </div><div dir="auto"><br></div><div dir="auto">Jésahel</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 11 oct. 2021 à 14:33, Yann Voté <<a href="mailto:ygversil@lilo.org">ygversil@lilo.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jésahel,<br>
<br>
Thanks for your reply. Your proposed solution would be fine if it was <br>
just me. What I forgot to say is the purpose: I want to share the QGIS <br>
project with other users who have limited QGIS skills.<br>
<br>
A user story would be: the user opens the QGIS project, selects the <br>
polygon layer A, selects the Generate Report action from the action <br>
menu, clicks on the desired polygon, and the PDF report for the clicked <br>
polygon gets generated.<br>
<br>
Or something similar with a processing algorithm.<br>
<br>
I think I found a workaround by using an atlas instead of a report. An <br>
atlas is OK for this particular case: main polygon layer A related with <br>
a non-geometric layer B whose data can be displayed within an Attribute <br>
Table item. Contrary to a report, an atlas output can be filtered with <br>
the `is_selected()` expression.<br>
<br>
I will continue to explore this path and let everyone know the found <br>
solution in the forum thread when I'm done.<br>
<br>
But I still believe that, for more complex use cases, namely maps in <br>
sections and related maps in subsections, which require a report, a <br>
filter option would be extremely useful.<br>
<br>
Regards.<br>
<br>
Yann<br>
<br>
<br>
Le 10/10/2021 à 23:20, Jésahel Benoist a écrit :<br>
> Hi Yann,<br>
> <br>
> As I'm often using reports based on filtered datas, and as I see that <br>
> you know how to filter, I don't really understand what is the problem. <br>
> You can just apply a filter in the main ui on the a or b layer, or make <br>
> virtual layers with only the needed datas. Then use the report (close <br>
> when a change is made in the main ui).<br>
> <br>
> Regards,<br>
> <br>
> Jésahel<br>
> <br>
> Le dim. 10 oct. 2021 à 18:53, Yann Voté <<a href="mailto:ygversil@lilo.org" target="_blank" rel="noreferrer">ygversil@lilo.org</a> <br>
> <mailto:<a href="mailto:ygversil@lilo.org" target="_blank" rel="noreferrer">ygversil@lilo.org</a>>> a écrit :<br>
> <br>
>     Hi everyone,<br>
> <br>
>     Let's imagine we have a polygon layer named Layer A with tons of<br>
>     features (tens of thousands), and an attribute layer named Layer B with<br>
>     even more features. Each polygon in Layer A is associated with one or<br>
>     more rows in Layer B.<br>
> <br>
>     Now suppose we have created a report with a top section for Layer A<br>
>     containing a map centered at each polygon, and a subsection for Layer B<br>
>     showing attributes for each related B row.<br>
> <br>
>     Is there a way to output the report for exactly one polygon in layer A,<br>
>     or for only some polygons (for example selected polygons) ?<br>
> <br>
>     And is there a way in the subsection to output only some of the related<br>
>     rows based on some filter expression ?<br>
> <br>
>     I am aware of this feature request<br>
> <br>
>     <a href="https://github.com/qgis/QGIS/issues/44821" rel="noreferrer noreferrer" target="_blank">https://github.com/qgis/QGIS/issues/44821</a><br>
>     <<a href="https://github.com/qgis/QGIS/issues/44821" rel="noreferrer noreferrer" target="_blank">https://github.com/qgis/QGIS/issues/44821</a>><br>
> <br>
>     but is there a way to achieve this with more steps in the UI or with<br>
>     pyQGIS ?<br>
> <br>
>     Thanks a lot !<br>
> <br>
>     Regards.<br>
> <br>
>     -- <br>
>     Yann Voté - <a href="mailto:ygversil@lilo.org" target="_blank" rel="noreferrer">ygversil@lilo.org</a> <mailto:<a href="mailto:ygversil@lilo.org" target="_blank" rel="noreferrer">ygversil@lilo.org</a>><br>
>     _______________________________________________<br>
>     Qgis-user mailing list<br>
>     <a href="mailto:Qgis-user@lists.osgeo.org" target="_blank" rel="noreferrer">Qgis-user@lists.osgeo.org</a> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank" rel="noreferrer">Qgis-user@lists.osgeo.org</a>><br>
>     List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
>     <<a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>><br>
>     Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
>     <<a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>><br>
> <br>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank" rel="noreferrer">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div>