Timeline for Print Composer Map with Table using PyQGIS
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 2, 2014 at 0:43 | comment | added | user25976 | Is anything like the setColumns method available for version 2.0? | |
Jul 15, 2014 at 18:42 | vote | accept | user25976 | ||
Jul 13, 2014 at 23:37 | comment | added | ndawson | I missed a character in the filter - it should have been "$id in ...". I've updated the answer with a complete working version of your code. | |
Jul 13, 2014 at 23:36 | history | edited | ndawson | CC BY-SA 3.0 |
added 2366 characters in body
|
Jul 11, 2014 at 18:57 | comment | added | user25976 | yes, I've just edited my post to include the code i'm trying. I've still got the same problem even after setting the vector layer and max amount of features. | |
Jul 11, 2014 at 0:45 | comment | added | ndawson | @user25976 have you set the layer for the attribute table? I left that off my original code. You'll need something like table.setVectorLayer( current_layer ). You may also need table.setMaximumNumberOfFeatures(20) to set the number of visible features. | |
Jul 11, 2014 at 0:40 | comment | added | user25976 | I'm working through these methods and trying to get the table to work. I end up with two little boxes without text in a very unexpected position on the page (using QgsComposerItem.setItemPosition()). I'm sure this is an error on my part. Questions: Is setAttribute() simply expecting a string of the attribute name? Any tips on integrating loadFromTemplate()? I do like your answer and will accept in a few days--just waiting a bit to see if there are any ideas as to how to get the feature form itself printed as my company's QGIS users are very familiar with the way it's formatted. | |
Jul 10, 2014 at 1:18 | comment | added | ndawson | @user25976: I've edited the answer to include this | |
Jul 10, 2014 at 1:17 | history | edited | ndawson | CC BY-SA 3.0 |
add filter for selected features
|
Jul 10, 2014 at 0:53 | comment | added | user25976 | This is helpful for displaying only desired attributes. I'm still looking however, for a way to display only the attributes of selected items. | |
Jul 9, 2014 at 23:25 | history | answered | ndawson | CC BY-SA 3.0 |