[Zope] DTML Mistotals

Clint Shelby McCulloch csm@io.com
Wed, 1 Mar 2000 15:07:55 -0600 (EST)


I think I found the problem, at least for my purposes. :)  I'm not sure
if this has already been corrected in the latest versions of DTML or not
but it might be worth a check.

DT_InSV.py line 239 was:
  s=item*item

Instead, I'm now using:
  if type(item)==type(1): s=item*long(item)
  else: s=item*item

Looks like this information is needed to calculate some of the other
statistics and when the item is a large integer it will cause an
exception.  The exception is then caught and results in that item
be omitted from some calculations, such as the total.

Hi Eric:

I'm not sure how much of what I've done would apply to your situation.
Basically, the powers that be wanted some complex reports for an Access
application hooked up to SQL Server.  Access reports were not anywhere
near flexible enough to produce the output they wanted.  Consequently,
I ended up building a reporting interface onto the rather low-level python
pdf module and then hooked it up to the DB.  That way I was able to
do most of the complex stuff in python, use DTML templates whenever
possible, and output the results in pdf.  When the user clicks on a report
in access, the application shells out without them knowing it and the
next thing they know a pdf pops out in Acrobat.

I gave some thought making it available to whoever might find it useful
but haven't had much time to make it more friendly.  In particular, I
might take the pdf wrapper, which allows for high level pdf
formatting (for switching font sizes, styles, page numbering, headings,
etc), and somehow hook it up to zope.  Sometime after I started,  someone
did come up with a pdf document hook for zope, but it didn't offer the
formatting options I needed and my reports weren't going through zope.  It
might be worth a look, however, for your purposes.

If you can get away with it, avoid PDF documents altogether and just use
DTML to web enable your reports through zope.  I ended up using pdf
because the users didn't want to web enable this stuff, wanted more
precision then browser formatting allowed, and I thought it would be kind
of neat to try....