quick fix: hide top spacing in text fields in reports
This commit is contained in:
		
							parent
							
								
									ff82b2bc49
								
							
						
					
					
						commit
						a67bb15dd0
					
				
					 1 changed files with 11 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -39,7 +39,17 @@ class TextField(Field):
 | 
			
		|||
 | 
			
		||||
    def getDisplayValue(self, row):
 | 
			
		||||
        value = self.getValue(row)
 | 
			
		||||
        return row.parent.context.view.renderText(value, self.format)
 | 
			
		||||
        text = row.parent.context.view.renderText(value, self.format)
 | 
			
		||||
        text = self.removeTopSpacing(text)
 | 
			
		||||
        return text
 | 
			
		||||
 | 
			
		||||
    def removeTopSpacing(self, text):
 | 
			
		||||
        styleInfo = u' style="margin-top: 0"'
 | 
			
		||||
        for tag in (u'<p', u'<ol', u'<ul'):
 | 
			
		||||
            if text.startswith(tag):
 | 
			
		||||
                text = tag + styleInfo + text[len(tag):]
 | 
			
		||||
                break
 | 
			
		||||
        return text
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class DecimalField(Field):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue