自定义报表问题
-
- tiny_sxw2rml 不允许非 ascii 的样式和字体名称等,这可以替换 tiny_sxw2rml.py 里的 latin-1 为 utf-8,但是替换以后还是不允许中文的字体名称存在
- 自定义的中文pdf报表,GTK的客户端可以下载,Web的不行,提示:
Unrecoverable error in the server.
===First Error===
Page handler: 'ordinal not in range(256)'
Traceback (most recent call last):
File "/usr/local/lib64/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/cherrypy/_cphttptools.py", line 127, in _run
cherrypy.response.finalize()
File "/usr/local/lib64/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/cherrypy/_cphttptools.py", line 429, in finalize
self.header_list = self.headers.sorted_list(protocol=self.version)
File "/usr/local/lib64/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/cherrypy/lib/httptools.py", line 488, in sorted_list
v = v.encode("iso-8859-1")
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 10-16: ordinal not in range(256)===Second Error===
Page handler: 'ordinal not in range(256)'
Traceback (most recent call last):
File "/usr/local/lib64/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/cherrypy/_cphttptools.py", line 448, in handleError
self.finalize()
File "/usr/local/lib64/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/cherrypy/_cphttptools.py", line 429, in finalize
self.header_list = self.headers.sorted_list(protocol=self.version)
File "/usr/local/lib64/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/cherrypy/lib/httptools.py", line 488, in sorted_list
v = v.encode("iso-8859-1")
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 10-16: ordinal not in range(256)总之, 它的报表子系统太烂了,这还不如直接用 odt/sxw 转成 odt/sxw呢,还省得麻烦,反正要求每个客户装个 openoffice 也不是什么大问题