I'd like to find a function or plugin for QGIS that displays vector data in a dynamic report. For example, I have a point vector layer "sample plots" that consists of 4 fields: ID, plot-number, comments and grade. I'd like to have a report or form that is linked to the dbf-file of that layer and displays the data dynamically in report. So if I add another point, it would show up on the report.

Does such a function or tool exist in QGIS?

  • Doesn't the attribute table do exactly that? – Erik Nov 9 '18 at 11:47
  • Not sure of your exact need but did you look at the report fonction of QGIS 3 ? Have a look at these link and if that's not what you need provide more detail on your expected output north-road.com/2018/01/23/… OR anitagraser.com/2018/01/21/creating-reports-in-qgis – J.R Nov 9 '18 at 13:05
  • For clarification: The report is supposed to have a header, the option to enter a date, and names of the people who did the survey of the plot (they change frequently). The attribute table would be one element of the report. I checked out the reports function in QGIS 3, but the created pdf-file at the end of the process is static. The perfect thing would be a plugin, that allows me to link dbf-fields to pdf-fields in a fillable pdf-form. – OnTheSurface Nov 9 '18 at 15:34
  • 2
    @OnTheSurface what if you connected your PostgreSQL database table / view to LibreOffice spreadsheet - this would be a dynamic view of your data in whatever format/layout you want... I posted a tutorial here: github.com/dpsspatial/Installation-Instructions/blob/master/… – DPSSpatial Nov 9 '18 at 17:56

If you wanted to use MS products, you can get a live connection to a shapefile DBF using Excel, but be warned: it can be quite laggy.

IMPORTANT: Your shapefile filename can only be 18 characters long using this method.

I've only tested this in Office 365.

  1. Go to Data > Get Data > From other sources > From ODBC
  2. Select dBASE Files as the DSN (Data source name) - it should be there by default
  3. Under Advanced Options > Connection string, paste the directory path of your dbf after dbq=, like so - make sure you include the terminal backslash in Windows: dbq=C:\users\files\shapefiles\
  4. Select Default or Custom for authentication, leave the credentials blank and click Connect
  5. Expand the folder and you will see your dbfs as a table that you can then load and manipulate using Power Query. If you get some weird error message chances are your dbf file name is too long, probably.

enter image description here

The power of this is you can rename the column names in this display, replace values, change column order, sort, etc. without touching any of the original data, much like a SQL VIEW would let you do.

If your original data has changed, you can refresh the table by selecting any cell and pressing Alt-F5. Or set it to do a background refresh by clicking on the table, going to Design > External Table Data > arrow button under Refresh > Connection Properties and setting a refresh interval:

enter image description here

Really, though, spatialite or better yet (if possible) Postgres would be the better way to store your data for faster retrieval and reporting.. Like DPSSpatial suggested in the comment: Visualizing PostGIS data in LibreOffice

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.