dabo Commit
Revision 5218
Date: 2009-05-15 16:12:46 -0700 (Fri, 15 May 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5218
Changed:
U branches/paul_reporting/dabo/lib/reportWriter.py
Log:
Seems to fix missing data (last paragraph or line of a deferred paragraph) in
my invoice.
Diff:
Modified: branches/paul_reporting/dabo/lib/reportWriter.py
===================================================================
--- branches/paul_reporting/dabo/lib/reportWriter.py 2009-05-15 21:24:36 UTC
(rev 5217)
+++ branches/paul_reporting/dabo/lib/reportWriter.py 2009-05-15 23:12:46 UTC
(rev 5218)
@@ -1031,7 +1031,7 @@
deferredStory = []
tot_p_height = 0
printStoryHeight = deferredStoryHeight = 0
- if neededHeight > availableHeight:
+ if neededHeight >= availableHeight:
printStory = []
for p, p_height in story:
tot_p_height += p_height
@@ -1042,7 +1042,7 @@
printStory.append((p, p_height))
printStoryHeight += p_height
neededHeight = printStoryHeight + padTop +
padBottom
-
+
if vAnchor == "top":
y = y - neededHeight
elif vAnchor == "middle":
@@ -1059,7 +1059,6 @@
else:
boundary = 0
-
for columnIndex in range(columnCount):
f = platypus.Frame(columnIndex*columnWidth, 0,
columnWidth, neededHeight, leftPadding=padLeft,
rightPadding=padRight,
topPadding=padTop,
@@ -1291,6 +1290,13 @@
objNeededHeight += p_height
story.append((p, p_height))
+ def hackDeferredPara():
+ """When a paragraph wraps to the next page, the
last line won't print if this isn't done."""
+ append_p = ParaClass("Hack: see
hackDeferredPara() in reportWriter.py", s)
+ p_height = p.wrap(99999, None)[1]
+ story.append((p, p_height))
+ hackDeferredPara()
+
neededHeight = objNeededHeight + padTop + padBottom
return story, neededHeight
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]