Bug report #17212

Attribute tables in print composer not updating

Added by David Gessel about 7 years ago. Updated about 7 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:2.18.13 Regression?:No
Operating System:Linux Mint 18.1, XFCE (but really Mate) 64 bit. Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:25111

Description

Problem

I have a large map, reading a KML file into a hierarchical shape layer in QGIS. The map has been in progress for about 18 months and was started with an earlier version of QGIS. One of the features I'm using is an attribute table in composer to enumerate data tables that are useful in the project but inconvenient to display on the map as labels (at least until some differential formatting of labels, such as HTML tags, are supported).

I made a change in the site labeling format in Google Earth and updated the KML file (from BX04 to BX.04, for clarity) which was reflected, as expected, in the field values visible in Expressions Dialog Map->Layer->Properties->Label With->Expression Dialog

updated values in map label editor expressions dialog

When I opened the composer window for a map, the field values were not updated. Print Composer->Attributes->Expression Dialog

stale data in attribute table expressions dialog in composer

Experiments

I attempted the following:

  • Click the "refresh table data" button (many times)
  • Click the "refresh view" button (many times)
  • Restart QGIS
  • Reboot computer
  • Check for updates (none)

Nothing seems to help. There's only stale data in the attribute table.

I created a new attribute table:

Even a new attribute table shows stale data

And it still has stale data (note that the map view shows current data)

I created a new composer, with a single base map, and added an attribute table, same result. I can't seem to get the attribute table data to sync with the map data. Help help help.

new-attribute-table-stale-data.png - Even a new attribute table shows stale data (18.5 KB) David Gessel, 2017-09-28 09:51 AM

values_in_attribute_table_composer.png - stale data in attribute table expressions dialog in composer (69.2 KB) David Gessel, 2017-09-28 09:51 AM

values_in_attribute_table_map-editor.png - updated values in map label editor expressions dialog (67.4 KB) David Gessel, 2017-09-28 09:51 AM

History

#1 Updated by David Gessel about 7 years ago

One artifact I forgot to mention: starting from the command line I get the following errors on startup, which may or may not be related:

Warning: QObject::connect: Incompatible sender/receiver arguments
QgsComposerItemComboBox::itemChanged(QgsComposerItem*) --> QgsComposerAttributeTableWidget::composerMapChanged(const QgsComposerItem*)

#2 Updated by Giovanni Manghi about 7 years ago

  • Category changed from Attribute table to Map Composer/Printing

#3 Updated by Nyall Dawson about 7 years ago

  • Status changed from Open to Feedback

It looks odd to me that the field names in the composer expression builder screenshot are truncated when compared to the other expression builder screenshot. E.g. altitudeMo instead of altitudeMode.

It might be a stupid question - but are you SURE the attribute table layer is the same layer?

#4 Updated by David Gessel about 7 years ago

OMG..... not stupid question.

Stupid answer, no. I examined the .qgs file, searched for "attribute" and, duh, the source is:

      <ComposerAttributeTableV2 vectorLayerName="All-Points" source="0" showGrid="1" maxFeatures="30" resizeMode="0" filterFeatures="false" featureFilter="" emptyTableMode="0" wrapString="" wrapBehaviour="0" headerMode="0" backgroundColor="255,255,255,255" showEmptyRows="0" emptyTableMessage="" showOnlyVisibleFeatures="1" vectorLayer="All_Points_shp20170601154059370" vectorLayerSource="../All_Points.shp" composerMap="0" headerHAlignment="0" contentFontColor="0,0,0,255" headerFontColor="0,0,0,255" cellMargin="1" filterToAtlasIntersection="0" relationId="" gridStrokeWidth="0.5" gridColor="0,0,0,255" showUniqueRowsOnly="0" vectorLayerProvider="ogr">

All_Points.shp...

not the KML file. My bad.

Certainly explains the stale data.

#5 Updated by Giovanni Manghi about 7 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

Also available in: Atom PDF