Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer: Attribute table draws some attributes without content #21435

Closed
qgib opened this issue Sep 20, 2015 · 2 comments
Closed

Composer: Attribute table draws some attributes without content #21435

qgib opened this issue Sep 20, 2015 · 2 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks

Comments

@qgib
Copy link
Contributor

qgib commented Sep 20, 2015

Author Name: Ondrej Remes (Ondrej Remes)
Original Redmine Issue: 13383
Affected QGIS version: master
Redmine category:map_composer/printing


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))

@qgib
Copy link
Contributor Author

qgib commented May 24, 2016

Author Name: Saber Razmjooei (@saberraz)


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


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jul 2, 2016

Author Name: Giovanni Manghi (@gioman)


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.


  • resolution was changed from to invalid
  • status_id was changed from Feedback to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks
Projects
None yet
Development

No branches or pull requests

1 participant