Re: [dabo-users] Printing conditional string on report page footer

Author: <lalong1@charter.net>

Posted: 2009-08-10 at 15:12:25

Paul,

I modified my version of reportWriter to render the pagefooter in endPage()

vs beginPage() and I can get it to do what I want (see diff below), but

another situation popped up...the deferred printing. Is there a

variable/attribute/property that I can query to tell me that the next page

is going to print the deferred info?

Thanks,

Larry

Index: reportWriter.py

===================================================================

--- reportWriter.py (revision 5306)

+++ reportWriter.py (working copy)

@@ -1797,7 +1797,9 @@

def beginPage():

# Print the static bands that appear below detail in z-order:

self._pageNumber += 1

- for band in ("pageBackground", "pageHeader", "pageFooter"):

+ #LAL - Move pagefooter write to endpage

+ #for band in ("pageBackground", "pageHeader", "pageFooter"):

+ for band in ("pageBackground", "pageHeader"):

printBand(band)

self._brandNewPage = True

@@ -1806,6 +1808,10 @@

x = self.getPt(self.ReportForm["Page"].getProp("MarginLeft"))

self.drawSpanningObjects((x,y))

printBand("pageForeground")

+

+ #LAL

+ printBand("pageFooter")

+

self.Canvas.showPage()

def reprintGroupHeaders(y):

@@ -1861,10 +1867,13 @@

vv = self._groupValues[group["expr"]]

if vv["curVal"] != group.getProp("expr"):

rp = eval(group.get("resetPageNumber", "False"))

- if rp and self._recordNumber == 0:

+ #LAL

+ #if rp and self._recordNumber == 0:

+ #self._pageNumber = 1

+ #elif rp:

+ #self._pageNumber = 0

+ if rp :

self._pageNumber = 1

- elif rp:

- self._pageNumber = 0

vv["curVal"] = group.getProp("expr")

np = eval(group.get("startOnNewPage", "False")) \

and self.RecordNumber > 0

> -----Original Message-----

> From: dabo-users-bounces@leafe.com

> [mailto:dabo-users-bounces@leafe.com] On Behalf Of Paul McNett

> Sent: Monday, August 10, 2009 2:21 PM

> To: Dabo Users list

> Subject: Re: [dabo-users] Printing conditional string on

> report page footer

>

> lalong1@charter.net wrote:

> > Close...but I think it's being evaluated against the first

> record on

> > the page vs the last.

>

> Page headers and footers print before groups and detail. So

> you are right, putting this expr in the page footer wouldn't

> work. And there's nothing equivalent to the group's

> ReprintHeaderOnNewPage for printing the footer on the old page.

>

> So... an oversight. I think it's logical to change the band

> printing so that the page footer prints after the

> group/detail for the page, however the detail band relies on

> knowing the used height of the page footer, so the page

> footer will have to have a fixed height.

>

> Or, I could make a group.PrintFooterOnOldPage, which might be

> technically better but harder to implement.

>

> If you just need to get this done now, you could put this in

> the PageForeground band, because here's the order of band

> printing on a page:

>

> PageBackground

> PageHeader

> PageFooter

> any continued detail (paragraph) from last page any group

> footers not printed yet any group header(s) any detail

> records any group footers PageForeground

>

> The trouble with PageForeground is that you need to give it

> absolute x,y positions (you need to account for margins

> yourself). So, if you wanted "continued on next page" to

> appear at the bottom of the page just inside the margins:

>

> <x>self.Report["Page"]["MarginLeft"]</x>

> <y>self.Report["Page"]["MarginBottom"]</y>

>

> ...and it would overprint anything else that happened to be there.

>

> Paul

>

>

>

[excessive quoting removed by server]

©2009 <lalong1@charter.net>