[reportlab-users] Re: Splitting error in table
Yura Asyutin
yasyutin at gmail.com
Wed Apr 19 14:36:03 EDT 2006
Part of code in platypus.tables._splitRows(), added rows are marked with
pluses:
def _splitRows(self,availHeight):
h = 0
n = 0
lim = len(self._rowHeights)
while n<self._hmax:
hn = h + self._rowHeights[n]
if hn>availHeight: break
h = hn
n = n + 1
if n<=self.repeatRows:
return []
if n==lim: return [self]
repeatRows = self.repeatRows
repeatCols = self.repeatCols
splitByRow = self.splitByRow
data = self._cellvalues
#we're going to split into two superRows
#R0 = slelf.__class__( data[:n], self._argW, self._argH[:n],
R0 = self.__class__( data[:n], self._colWidths, self._argH[:n],
repeatRows=repeatRows, repeatCols=repeatCols,
splitByRow=splitByRow)
#copy the styles and commands
R0._cellStyles = self._cellStyles[:n]
A = []
+ # hack up the span commands
+ A.extend(self._spanCmds)
# hack up the line commands
Regards, Yura
2006/4/19, JP Glutting <jpglutting at oqua.udl.es>:
>
> Thanks Yura,
>
> This looks very interesting. Can you tell me where in _splitRows you put
> this code? I would liek to try this - I have a lot of long tables with
> spans in them (especially in the headers).
>
> Cheers,
> JP
>
> Yura Asyutin wrote:
>
> >
> > In my case, error occured in case of using spanning style in table,
> > when large table was splitted to seperate pages. I fixed this adding
> > this code in platypus.tables._splitRows():
> >
> >
> > A.extend(self._spanCmds)
> >
> > Error occured, because after splitting table, span style was not
> applied.
> >
> > Best Regards, Yura
> >
> >
> > 2006/4/17, William Dode <wilk-ml at flibuste.net
> > <mailto:wilk-ml at flibuste.net>>:
> >
> > On 24-03-2006, Yura Asyutin wrote:
> > > --===============1857253020==
> > > Content-Type: multipart/alternative;
> > > boundary="----=_Part_10863_7848469.1143199323023"
> > >
> > > ------=_Part_10863_7848469.1143199323023
> > > Content-Type: text/plain; charset=ISO-8859-1
> > > Content-Transfer-Encoding: quoted-printable
> > > Content-Disposition: inline
> > >
> > > I want to announce again problem with splitting error in table,
> > that is
> > > described by Andy on *9 Sep 2004.
> > >
> > > I have the same problem while rendering PDF document, ReportLab
> > can't split
> > > table.
> > >
> > > How to fix it?
> >
> > i think i've the same problem, any idea ?
> >
> > --
> > William Dodé - http://flibuste.net
> >
> > _______________________________________________
> > reportlab-users mailing list
> > reportlab-users at reportlab.com <mailto:reportlab-users at reportlab.com>
> > http://two.pairlist.net/mailman/listinfo/reportlab-users
> >
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >reportlab-users mailing list
> >reportlab-users at reportlab.com
> >http://two.pairlist.net/mailman/listinfo/reportlab-users
> >
> >
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://two.pairlist.net/pipermail/reportlab-users/attachments/20060419/0d7facba/attachment.html
More information about the reportlab-users
mailing list