[reportlab-users] Re: Splitting error in table

JP Glutting jpglutting at oqua.udl.es
Thu Apr 20 05:26:04 EDT 2006


Excellent! That works quite nicely. I am not sure if I will use it all 
that much now, because the solution I threw together has the advantage 
of printing the header on each page, which I have gotten used to, but I 
will certainly use it whenever possible. I can save about 20 lines of 
code for each table with this.

Also, I am going to take a look at applying this to the LongTable 
object, which I use as well.

Thanks very much,

JP

Yura Asyutin wrote:

> 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 
> <mailto: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>
>     > <mailto: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>
>     <mailto: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 <mailto:reportlab-users at reportlab.com>
>     > http://two.pairlist.net/mailman/listinfo/reportlab-users
>     >
>     >
>
>     _______________________________________________
>     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
>  
>


-- 
____________________________________________________

Oficina de Qualitat	 	Tel: 973 703 103			
Universitat de Lleida	   	Fax: 973 702 036	

Pl. Víctor Siurana, 1	
25003 Lleida	
____________________________________________________	



More information about the reportlab-users mailing list