Ignore:
Timestamp:
13 Nov 2018, 12:06:46 (6 years ago)
Author:
Henrik Bettermann
Message:

Adjust the first 4 columns.

File:
1 edited

Legend:

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

    r15237 r15238  
    10351035        pdf_data.append(Spacer(1, 20))
    10361036        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
     1037        # Adjust size of the first 4 columns.
     1038        maxlength = [0,0,0,0]
    10401039        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
     1040            for i in range(4):
     1041                if len(line[i]) > maxlength[i]:
     1042                    maxlength[i] = len(line[i])
     1043        for i in range(4):
     1044            colwidth[i] = maxlength[i] * 0.225 * cm
     1045        import pdb; pdb.set_trace()
    10441046        pdf_data += [Table(data[0], colwidth, style=CONTENT_STYLE)]
    10451047        # Process title if too long
Note: See TracChangeset for help on using the changeset viewer.