Bug report #13383

Composer: Attribute table draws some attributes without content

Added by Ondrej Remes about 5 years ago. Updated over 4 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:21435

Description

In Map Composer I try make 11 sides long report width attribute table, where I has modified one attribute through function editor (python, ogr, execute sql). When I pass shortcut of tree the function returns latin and czech name of tree. Everything works quite fine but attribute table has some rows where attribute "name of tree" is empty. Maybe 10 - 15 rows in 250 rows long attribute table. When I update table, empty places are shifted, but count of white places will not change.

There is code of python function:

from qgis.core import *
from qgis.gui import *
import os

@qgsfunction(args='auto', group='Custom')
def nacistTabDrUp(value1, feature, parent):

    def nacistTabDr():
        from osgeo import ogr
        prjpath = QgsProject.instance().fileName()
        con = ogr.Open(os.path.dirname(prjpath) + "/tab_dr.dbf")  
        print(con)
        rows = con.ExecuteSQL("SELECT * FROM tab_dr")
        tax_lat_ = {}
        tax_cz_ = {}

        for i in rows:
            tax_lat_[i.GetField("znacka")] = i.GetField("TAXON")
            if i.GetField("znacka") == "PAREZ":
                tax_cz_[i.GetField("znacka")] = "" 
            else:
                tax_cz_[i.GetField("znacka")] = i.GetField("cs_nazev")
        return (tax_lat_, tax_cz_) 
        con.close()

    def doplnitNazev(zkrt):
        tax_latx = {}
        tax_czx = {}
        tax_latx, tax_czx = nacistTabDr()
        try: return (tax_latx[zkrt] +"\
"+ tax_czx[zkrt])
        except KeyError: return[zkrt]

    return unicode(doplnitNazev(value1))

History

#1 Updated by Saber Razmjooei over 4 years ago

  • Status changed from Open to Feedback

I'd ask the mailing list for help. Not clear what exactly the bug is?

#2 Updated by Giovanni Manghi over 4 years ago

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

I agree that this is not clear if is a bug report.

Closing for lack of feedback, please reopen if necessary, eventually adding more details.

Also available in: Atom PDF