python:reportlab:excel表格与大小不匹配

python:reportlab:excel表格与大小不匹配,python,reportlab,Python,Reportlab,我尝试读取并打印一个Exceltable(带有文本,umlauten$%°())。我使用xlrd进行读取,并使用reportlab进行打印。结果很糟糕。我的表格不适合sitze,文本没有每列的换行符,因此列宽太宽。有没有办法强迫reportlab这样做? 这是我的密码: >import xlrd >wb = xlrd.open_workbook("test.xls", >encoding_override="UTF-8")#"iso-8859-1") >wb.sheet

我尝试读取并打印一个Exceltable(带有文本,umlauten$%°())。我使用xlrd进行读取,并使用reportlab进行打印。结果很糟糕。我的表格不适合sitze,文本没有每列的换行符,因此列宽太宽。有没有办法强迫reportlab这样做? 这是我的密码:

>import xlrd
>wb = xlrd.open_workbook("test.xls", 
>encoding_override="UTF-8")#"iso-8859-1")
>wb.sheet_names()
>sh = wb.sheet_by_index(0)
>
>rows = []
>for row_number in xrange(sh.nrows):
>     rows.append(sh.row_values(row_number))
>
>data=[row for row in rows]
>
>
>from reportlab.lib import colors
>from reportlab.lib.pagesizes import letter
>from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph
>from reportlab.lib.styles import getSampleStyleSheet
>from reportlab.lib.units import inch
>from reportlab.platypus.paragraph.cleanBlockQuotedText
>styles = getSampleStyleSheet()
>doc = SimpleDocTemplate("simple_table.pdf", pagesize=letter)
>
>elements = []
>
>t=Table(data)
>elements.append(t)
>doc.build(elements)

有人看到我的错误了吗?谢谢

您似乎没有对数据做任何处理-为什么不以Excel格式打印它呢?我将把它放在Latex中。在本例中,缺少一个零件。我做了两件事:1。2行2。字母的字体和大小应该和乳胶相适应