Re: Database reporting

Paul McNett <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <[email protected]>
On 6/1/13 11:31 PM, Werner F. Bruhin wrote:
> I am aware of it but had the impression that it expects a Dabo bisobj

No, it's database agnostic. It just expects a sequence of mappings as a 'dataset'.

> , could I use it
> with using SQLAlchemy to access my database? I.e. feed it a SQLAlchemy query and
> access relations to get at columns?

I don't know about SA. Dabo's reportwriter wants denormalized data. So select all the
rows, columns you want out of whatever tables, and set up grouping in the report
designer.

> 
> e.g.:
> result = session.query(db.Winerack)
> 
> for r in result:
>     print r.name
>     for u in r.wineracku:
>         print u.description
>         for b in u.winerackb:
>             print b.description, b.binno
>             for i in b.winerackit:
>                 print i.subbinno
>                 if i.bottag:
>                     print i.bottag[0].cellarbook.drinkinfo.name
> 
> 
> the "for" loops would be groups and the last one would be the detail level which
> might need one or more lines.  In some of the reports the "more lines" would be large
> text blob column which is the one which might need to span over multiple pages.

This case is handled well with dabo's report writer. You won't write the for loops
though, just set up the groupings in the format and provide the denormalized data.

Paul
_______________________________________________
reportlab-users mailing list
[email protected]
http://two.pairlist.net/mailman/listinfo/reportlab-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.