Report writer for use with wxPython

Can anyone recommend a report writer package that could be integrated well into a wxPython app?

Thanks,
Michael

Michael,

I have not used it , but I have read good things about ReportLab:

http://www.reportlab.org/

Ira

Michael Hipp wrote:

···

Can anyone recommend a report writer package that could be integrated well into a wxPython app?

Thanks,
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Hi Michael

There are several possibilities:

Reportlab is a good tool if you want to generate PDF reports, however, you
have to code the reports yourself, it does not have a GUI.

OpenOffice has a nice reportwriter part that connects to any SQL database,
however, to interact with it thru Python requires PyUno, and other tricks
(like oood.py), but it all depends on the level of sofistication you want. I
am using this also, and it works nicely. To get it bulletproof is a nightmare
because users have so many options.

There are other reportwriters around I have not used. agatha I have briefly
explored is also a nice one.

Cheers,
Dick Kniep

Hi Michael,

Michael Hipp wrote:

Can anyone recommend a report writer package that could be integrated well into a wxPython app?

I use Report Manager (http://reportman.sourceforge.net/), it has a very nice report designer (similar to R&R or Crystal Reports) and to run the reports from within Python I use the command line tool by calling this function:

    def RunReport(self, report):
        self.Hide()
        locales = self.prefs.language.locales
        if locales == 'fr':
            lang = 3
        elif locales == 'de':
            lang = 5
        else:
            lang = 0
        self.Getds().close()
        retval = os.system(("printrepxp.exe -preview -showparams -paramLANG=%i %s") % (lang, report))
        self.ReConnectDB()
        if self.IsShown() == False:
            self.Show()

I am using Firebird SQL embedded, that is why I need to close the db connection, run the report and open it again.

Note that the reports support multi languages.

You might also want to look at Dabo (http://dabodev.com/), I believe they are working on a Report Designer and are using Report Lab.

Werner

···

Thanks,
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

I've only played around with their report designer, but it looks
promising. And I can tell you that it's being very actively developed,
with lots of changes committed every day. It's still not ready yet,
but it looks like it creates a banded layout where you drop the fields
you want into each band, and then when you run it, sends the result to
ReportLab.

···

On 1/27/06, Werner F. Bruhin <werner.bruhin@free.fr> wrote:

You might also want to look at Dabo (http://dabodev.com/), I believe
they are working on a Report Designer and are using Report Lab.

--

# p.d.

Peter Decker wrote:

You might also want to look at Dabo (http://dabodev.com/), I believe
they are working on a Report Designer and are using Report Lab.

I've only played around with their report designer, but it looks
promising. And I can tell you that it's being very actively developed,
with lots of changes committed every day. It's still not ready yet,
but it looks like it creates a banded layout where you drop the fields
you want into each band, and then when you run it, sends the result to
ReportLab.

Yes, it is "banded", meaning that you lay out objects inside bands such as PageHeader/PageFooter, which prints at the top/bottom of each page, Detail which prints once per iteration of the "Cursor", which is your dataset.

The types of objects you can put in bands are things like:

  String
  Rectangle
  Line
  Image

And each object has a set of properties you can set. The properties are dynamically eval()'d at runtime giving you supreme control. For instance, a String property may have the following props set:

  expr: "self.Record['LastName']"
  fontColor: "'black' if self.Record["amount"] > 0 else 'red'"

Note that this dynamic fontColor expression would only work in future versions of Python, but you get the idea: dynamic properties depending on conditions evaluated with each iteration of the dataset.

At runtime, you take your report form and a dataset, and send them to the report writer, and you get a PDF that you can display, print, whatever.

There's the concept of report "Groups", which have their own GroupHeader/GroupFooter bands. You can have unlimited groups, and each group has properties such as:

  expr: the group expression, such as 'self.Record["ClientId"]'
  ReprintHeaderOnNewPage
  
When with the iteration of the dataset the ClientId value changes, the GroupFooter band will print after the Detail band, and on the next iteration you'll get the GroupHeader printed.

There are also report "Variables" for tracking subtotals, etc.

The report writer communicates with reportlab, which creates the pdf output. We expose the reportlab canvas object should the developer find the need to deal directly with reportlab for certain cases.

There is also an OOP way to create dynamic report designs at runtime without having the rfxml file, although I must say the XML file is very easy to deal with.

Everything I've described above is working right now, API-wise. IOW, if you know how to craft the rfxml file by hand, and you know how to combine that with a dataset at runtime, you can get a nice PDF. What I'm focusing on now is the Report Designer, which lets you craft the rfxml report design graphically instead of manually. This actually is working but at a minimal level. We are close.

As usual, docs are non-existent though.

···

On 1/27/06, Werner F. Bruhin <werner.bruhin@free.fr> wrote:

--
Paul