In a project let's add 3 layers: 'layerA', 'layerB', 'layerC'
In a Print layout, enable atlas generation on 'layerA'
Add an attribute table, select layer features, and use 'layerB' as source
1/ If you switch layers in the attribute table Layer combobox, the attribute table item is updated accordingly. Great.
2/ Now in the data-defined option beside Layer combobox, use expression like @case when @atlas_featureid %2 then 'layerB' else 'layerC' end@
Preview the atlas and you'll notice that attribute table changes according to atlas feature ID. also Great.
3/ Now instead of using 'layerB' as attribute table source, select 'layerC' in the Layer combobox (while the DD button is still active). The table structure is not refreshed, even if you click on "refresh table data" or "attributes" (this one still shows layerB structure).
I'd expect attribute table columns being the ones of the layer currently shown in the combobox.
The only way I can change the underlying table structure is to redraw a new table.
Author Name: Harrissou Santanna (@DelazJ) Original Redmine Issue: 18699 Affected QGIS version: 3.1(master) Redmine category:map_composer/printing
In a project let's add 3 layers: 'layerA', 'layerB', 'layerC' In a Print layout, enable atlas generation on 'layerA' Add an attribute table, select layer features, and use 'layerB' as source
1/ If you switch layers in the attribute table Layer combobox, the attribute table item is updated accordingly. Great.
2/ Now in the data-defined option beside Layer combobox, use expression like @case when @atlas_featureid %2 then 'layerB' else 'layerC' end@ Preview the atlas and you'll notice that attribute table changes according to atlas feature ID. also Great.
3/ Now instead of using 'layerB' as attribute table source, select 'layerC' in the Layer combobox (while the DD button is still active). The table structure is not refreshed, even if you click on "refresh table data" or "attributes" (this one still shows layerB structure). I'd expect attribute table columns being the ones of the layer currently shown in the combobox.
The only way I can change the underlying table structure is to redraw a new table.