I'm a bit new to the QGIS world. I have been trying to set up a print composer layout with PyQGIS. I want to generate a map and add a table beneath. I would like to get the source of the data for this table by running an SQL command - is this possible and how? I am asking because I see suggestions to convert / load the data from CSV but my process is a bit different from that. So can I add this table by running an SQL command on my database?

  • Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq. – underdark Apr 13 '17 at 16:58
  • Thanks for the welcome, however, I am not so new to the community. I am new to QGIS as I have indicated. I understand that it would be more helpful for my question to have more detail but I am not so sure what kind of additional detail I need to provide in my context. My question is somewhat abstract and I am asking in the gis community because I suppose someone else here must have surely encountered this challenge. – Zeruno Apr 13 '17 at 18:01
  • You could post your code? (or a Screenshot where you want to have what) When you are creating a print-composer with PyQGIS you can of course query your database and fill a html table with your data and add this table to your print composer. – AndreasK Apr 18 '17 at 7:58

Your Answer

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

Browse other questions tagged or ask your own question.