[reportlab-users] How to mix static positioning and flowables

Mike Driscoll mike at pythonlibrary.org
Thu Aug 8 15:29:08 EDT 2013


Hi,

I have been experimenting using the table and I notice that when I use
table.drawOn(), it changes position depending on how many rows of data I
pass the table. Why won't the table start at the position I'm passing it
every single time?

Right now, my plan is to find out how many rows of data I can fit on the
bottom half of the page and then add a check that says, if number of rows
is greater than X, only pass X rows of data to the table and save the
following rows into a new list. Then I'll add a page break, create a new
table and pass it the new list. However since the table refuses to actually
stay where I tell it, I'm not sure I can even use a table object at this
point. Any suggestions?

- Mike


On Wed, Aug 7, 2013 at 12:27 PM, Mike Driscoll <mike at pythonlibrary.org>wrote:


> Hi Andy,

>

> In this case, the static content only appears on the first page. The table

> can then continue for however many pages after that as needed. I do have an

> older project where I did have the same static stuff on each page with a

> flowing table across pages and sub-totals per page that I ended up writing

> a hack for. I'm trying not to do that for this one.

>

> - Mike

>

>

> On Wed, Aug 7, 2013 at 11:54 AM, Andy Robinson <andy at reportlab.com> wrote:

>

>> Does the static content

>> (a) only need to appear on Page 1?

>> (b) need to appear identically on every page?

>> (c) need to vary by page?

>>

>> All of these are possible but would use different approaches..

>>

>> - Andy

>>

>> On 7 August 2013 16:20, Mike Driscoll <mike at pythonlibrary.org> wrote:

>> > Hi,

>> >

>> > I have a project where I'm basically creating a document where the top

>> half

>> > has to be positioned exactly and the second half is a table that can run

>> > multiple pages. I was doing the static part using Reportlab's canvas

>> object,

>> > but I can't figure out how to make the table split across multiple

>> pages if

>> > it gets too long.

>> >

>> > All the resources I've found so far recommend using a Template like

>> > BaseDocTemplate, but I don't see any way to use that to mix the static

>> > content and the dynamic content on one page.

>> >

>> > I have attached what I've come up with so far, but the table obviously

>> > doesn't split. Any help would be appreciated. Thanks!

>> >

>> > -------------------

>> > Mike Driscoll

>> >

>> > Blog: http://blog.pythonlibrary.org

>> >

>> > _______________________________________________

>> > reportlab-users mailing list

>> > reportlab-users at lists2.reportlab.com

>> > http://two.pairlist.net/mailman/listinfo/reportlab-users

>> >

>>

>>

>>

>> --

>> Andy Robinson

>> Managing Director

>> ReportLab Europe Ltd.

>> Thornton House, Thornton Road, Wimbledon, London SW19 4NG, UK

>> Tel +44-20-8405-6420

>> _______________________________________________

>> reportlab-users mailing list

>> reportlab-users at lists2.reportlab.com

>> http://two.pairlist.net/mailman/listinfo/reportlab-users

>>

>

>

>

> --

> -----------------

> Mike Driscoll

>

> Blog: http://blog.pythonlibrary.org

>




--
-----------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20130808/a5e71fbf/attachment.html>


More information about the reportlab-users mailing list