Ignore:
Timestamp:
13 Nov 2018, 11:04:15 (6 years ago)
Author:
Henrik Bettermann
Message:

Adjust column width for matric numbers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r15235 r15237  
    10341034                mapping = {'a':data[1][5],'b':data[1][6]})), style["Normal"]),]
    10351035        pdf_data.append(Spacer(1, 20))
    1036         pdf_data += [Table(data[0], style=CONTENT_STYLE)]
     1036        colwidth = colWidths=[None] * len(data[0][0])
     1037        # The length of matric numbers can be different. We have to
     1038        # find the longest one.
     1039        maxlength_matric_no = 0
     1040        for line in data[0]:
     1041            if len(line[2]) > maxlength_matric_no:
     1042                maxlength_matric_no = len(line[2])
     1043        colwidth[2] = maxlength_matric_no * 0.225 * cm
     1044        pdf_data += [Table(data[0], colwidth, style=CONTENT_STYLE)]
    10371045        # Process title if too long
    10381046        title = " ".join(view.context.title.split())
Note: See TracChangeset for help on using the changeset viewer.