Wednesday, 16 November 2016

Creating a custom attribute table in qgis print composer


is it possible to arrange header and content of an inserted attribute table in qgis print composer? I want to create a custom datasheet with a small map and listed feature information as follows:datasheet with header and content aof an attribute table arranged side by side


I thought to change header font into white (and insert a label for each attribute content) but apparently this is not possible in qgis 2.0.



Answer



If you want to do a datasheet for each feature in a table, then you can use the atlas generation functionality in the print composer.



In the atlas generation tab, set the coverage layer to the layer where you have your features. Make sure you uncheck the Hidden coverage layer box in Visibility. And set the scaling according to your needs.


Entering a new label, you can access your features attribute values by using [%yourFeatureAttributeName%]. See the image below for a example:


enter image description here


You can even render your label as HTML to create a table. Something like this:
















Code [%code%]
Page number [%"page_number"%]
district [%district%]


After you set the composer layout as you please, all you need is to do is create the outputs or print. You will get one output per feature, the map will be centered or zoomed on each feature, and the labels will show the features attributes.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...