Discussion:
[Erp5-dev] Listbox - erp5_accounting pdf reports broken
Shrenik Bhura
2006-07-12 14:47:24 UTC
Permalink
It seems the changes made in revision 7837(the first step of refactoring
ListBox) for ListBox.py have broken the pdf template based reports of
erp5_accounting.

I'm aware that the ListBox.py has undergone a major overhaul and is still
being worked upon. Please let me know if there is any knowledge of the above
bug and its status.

Thanks,
SB
Shrenik Bhura
2006-07-12 14:52:13 UTC
Permalink
It seems the changes made in revision 7837(the first step of refactoring
ListBox) for ListBox.py have broken the pdf template based reports of
erp5_accounting.

I'm aware that the ListBox.py has undergone a major overhaul and is still
being worked upon. Please let me know if there is any knowledge of the above
bug and its status.

The error:
Request URL
http://xxxxxxxx/erp5/account_module/AccountModule_viewGeneralLedgerReport
Exception Type AssertionError
Exception Value table is too wide already, cannot choose a sane width for
undefined columns

Traceback (innermost last):

*

Module ZPublisher.Publish, line 101, in publish
099 | missing_name,
100 | dont_publish_class,
101>| request, bind=1)
102 |
103 | if result is not response:

*

Module ZPublisher.mapply, line 88, in mapply
086 |
087 | args=tuple(args)
088>| if debug is not None: return debug(object,args,context)
089 | else: return object(*args)

*

Module ZPublisher.Publish, line 39, in call_object
037 |
038 |def call_object(object, args, request):
039>| result=apply(object,args) # Type s<cr> to step into published
object.
040 | return result
041 |

*

Module Products.ERP5Form.Report, line 147, in __call__
145 | extra_context['here'] = object
146 | extra_context['report_method'] = report_method
147>| return pt.pt_render(extra_context=extra_context)
148 |
149 | def _exec(self, bound_names, args, kw):

*

Module Products.ERP5Form.PDFTemplate, line 165, in pt_render
163 |
164 | report_tool = getToolByName(self, 'portal_report')
165>| pdf = report_tool.renderPDF(self.pdf_stylesheet, doc_xml,
context=self.pt_getContext()['here'], *args, **kwargs)
166 | if request and not batch_mode:
167 |
request.RESPONSE.setHeader('Content-Type','application/pdf')

*

Module Products.ERP5Form.PDFTemplate, line 323, in renderPDF
321 | # create the PDF itself using the document and the template
322 | buf = StringIO()
323>| document(template,buf)
324 | buf.seek(0)
325 | return buf.read()

*

Module Products.CMFReportTool.RenderPDF.Parser, line 802, in __call__
800 | def __call__(self,template,out=None):
801 | doc = self._create(template)
802>| return doc.create(template,out)

*

Module Products.CMFReportTool.RenderPDF.Platypus, line 158, in create
156 | fname = out or self.filename or template.filename
157 | stylesheet = template.getStyleSheet()
158>| return template.build(map(lambda x,
st=stylesheet:x.getFlowable(stylesheet=st),self.content),filename=fname)
159 |
160 |

*

Module Products.CMFReportTool.RenderPDF.Platypus, line 753, in build
751 | while len(flowables):
752 | self.clean_hanging()
753>| self.handle_flowable(flowables)
754 |
755 | self._endBuild()

*

Module reportlab.platypus.doctemplate, line 562, in handle_flowable
560 | else:
561 | #try to fit it then draw it
562>| if self.frame.add(f, self.canv,
trySplit=self.allowSplitting):
563 | self._curPageFlowableCount =
self._curPageFlowableCount + 1
564 | self.afterFlowable(f)

*

Module reportlab.platypus.frames, line 124, in _add
122 | if h>0:
123 | flowable.canv = canv #so they can use stringWidth etc
124>| w, h = flowable.wrap(aW, h)
125 | del flowable.canv
126 | else:

*

Module reportlab.platypus.tables, line 793, in wrap
791 |
792 | def wrap(self, availWidth, availHeight):
793>| self._calc(availWidth, availHeight)
794 | #nice and easy, since they are predetermined size
795 | self.availWidth = availWidth

*

Module reportlab.platypus.tables, line 439, in _calc
437 | #this CHANGES the widths array.
438 | if (None in self._colWidths or '*' in self._colWidths) and
self._hasVariWidthElements():
439>| W = self._calcPreliminaryWidths(availWidth) #widths
440 | else:
441 | W = None

*

Module reportlab.platypus.tables, line 539, in _calcPreliminaryWidths
537 | newColWidths = list(W)
538 | guessColWidth = (availWidth - totalDefined) /
(len(unsizeable)+len(sizeable))
539>| assert guessColWidth >= 0, "table is too wide already,
cannot choose a sane width for undefined columns"
540 | if verbose: print 'assigning width %0.2f to all undefined
columns' % guessColWidth
541 | for colNo in sizeable:

AssertionError: table is too wide already, cannot choose a sane width for
undefined columns


Thanks,
SB

Loading...