Changeset 10568 for main


Ignore:
Timestamp:
31 Aug 2013, 04:47:12 (11 years ago)
Author:
Henrik Bettermann
Message:

We have to preset colWidths. _calcPreliminaryWidths of the Platypus Table class seems to have problems with rotated text.

File:
1 edited

Legend:

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

    r10567 r10568  
    9898    col_names = ('Student Id', 'Matric No.', 'Name',
    9999                     TTR('Total Credits'), TTR('Total Credits Passed'),
    100                      'GPA', 'Courses Failed')
     100                     TTR('GPA'), 'Courses Failed')
    101101    table = [col_names]
    102102    for line in data:
     
    110110    #('FONT', (0,-1), (-1,-1), 'Helvetica-Bold', 8), # last row
    111111    #('FONT', (-1,0), (-1,-1), 'Helvetica-Bold', 8), # last column
    112     ('ALIGN', (1,1), (-1,-1), 'RIGHT'),
    113     ('ALIGN', (2,0), (2,-1), 'LEFT'),
     112    ('ALIGN', (3,1), (-1,-1), 'RIGHT'),
     113    #('ALIGN', (1,0), (1,-1), 'LEFT'),
     114    #('ALIGN', (2,0), (2,-1), 'LEFT'),
     115    ('ALIGN', (6,0), (6,-1), 'LEFT'),
    114116    ('INNERGRID', (0,1), (-1,-1), 0.25, colors.black),
    115117    ('BOX', (0,1), (-1,-1), 1, colors.black),
     
    145147        table_data = tbl_data_to_table(self.data)
    146148        #col_widths = [3.5*cm] * len(self.data[0])
     149        col_widths = [2*cm, 2*cm, 5*cm, 0.8*cm, 0.8*cm, 0.8*cm, 6*cm, ]
    147150        pdf_data = [Paragraph('<b>%s</b>' % self.creation_dt_string,
    148151                              STYLE["Normal"]),
     
    153156                    Spacer(1, 12),]
    154157        pdf_data += [
    155             Table(table_data, style=TABLE_STYLE)] #, colWidths=col_widths)]
     158            Table(table_data, style=TABLE_STYLE, colWidths=col_widths)]
    156159        doc_title = 'Level Report'
    157160        pdf = creator.create_pdf(
Note: See TracChangeset for help on using the changeset viewer.