reporting framework for wx

Paul McNett wrote:

> Chris Barker wrote:
> > By the way, how are you generating the pdf? Reportlab? or roll your > own?

> Reportlab.

Hi all,

I run ReportLab and have just been alerted to this thread by
Andreas Kaiser on our own list. We (in-house) and several of our
users have been on the lookout for a way to build a document-design tool
for some time. We have only played with wxPython, but we all prefer it
to the other Python GUI toolkits so far. So, I'd be very keen to explore possibilities for a design tool, and some of our user group
have expressed an interest on working with it.

Some wiki-space sounds good to record and organize ideas.

What we're looking for is not necessarily a classic horizontal-bands
database reporting tool, but rather a 'drawing program' into which
it's easy to plug new objects, and inspect their properties in a side
panel - a lot like a VB or Delphi or Boa-like IDE, but with a 'visual
view' or three for what you are designing. I think
we could easily adapt such a tool to output the objects in a reportlab
model, and render to PDF; or, perhaps, save an intermediate XML representation so others could make HTML or Word or whatever from it. And it would be easy to make anything a 'data placeholder' so you can run in a loop over any object model.

I have read about OGL but never used it. Is it a good basis for
this kind of thing? Are there other good starting points?

Also, I'm looking actively at code to render PDF. XPDF have a great
PDF OCX viewer component which they sell on Windows but I believe is
GPL-based. And Sketch (now Skencil) has all the code to import EPS
and other formats to get graphics in. Tracing over the top of existing PDFs is a great way to save time in design.

Please be patient while I learn my way around wxPython :wink:

Best Regards,

Andy Robinson
CEO/Chief Architect
ReportLab Europe Ltd.

···

Subject: Re: [wxPython-users] reporting framework for wx
From: Paul McNett
Date: Tue, 22 Nov 2005 16:04:02 -0800

Andy Robinson wrote:

Subject: Re: [wxPython-users] reporting framework for wx From: Paul
McNett Date: Tue, 22 Nov 2005 16:04:02 -0800

Paul McNett wrote: Chris Barker wrote:

By the way, how are you generating the pdf? Reportlab? or roll
your

own?

Reportlab.

Hi all,

I run ReportLab and have just been alerted to this thread by Andreas
Kaiser on our own list. We (in-house) and several of our users have
been on the lookout for a way to build a document-design tool for
some time. We have only played with wxPython, but we all prefer it to the other Python GUI toolkits so far. So, I'd be very keen to explore possibilities for a design tool, and some of our user group have expressed an interest on working with it.

We ( I at least :slight_smile: ) are happy about this!

Some wiki-space sounds good to record and organize ideas.

Tell us where you want to talk and we'll be

What we're looking for is not necessarily a classic horizontal-bands database reporting tool, but rather a 'drawing program' into which it's easy to plug new objects, and inspect their properties in a side
panel - a lot like a VB or Delphi or Boa-like IDE, but with a
'visual view' or three for what you are designing.

I think that the idea of make the proprieties (I think you suppose
something like size, color, font, position, etc... for the text ) into a
side panel is good, but why not use the " classic horizontal-bands"?
How do you think to divide the logical paper structure (header, text,
footer, separators, etc..)?

I think we could easily adapt such a tool to output the objects in a
reportlab model, and render to PDF; or, perhaps, save an intermediate
XML representation so others could make HTML or Word or whatever from
it.

Or make the preview directly from the wx application, if there is the
engine the create it!

Also, I'm looking actively at code to render PDF. XPDF have a great PDF OCX viewer component which they sell on Windows but I believe is GPL-based.

With a solution OCX based, with limit the usage on windows platforms,
and I don't think that this is a good solution...

And Sketch (now Skencil) has all the code to import EPS and other
formats to get graphics in. Tracing over the top of existing PDFs
is a great way to save time in design.

Yes, but you have to have already some pdf created!

Have you seen my modifies made over pySketch? Can be a good point of start?
Now I'm ending the "TextObject" and the align/size functions.

Michele

I think that the idea of make the proprieties (I think you suppose
something like size, color, font, position, etc... for the text ) into a
side panel is good, but why not use the " classic horizontal-bands"?
How do you think to divide the logical paper structure (header, text,
footer, separators, etc..)?

Believe it or not, we have NEVER had a customer project which
looked anything like a database report. I would describe what
we do as more like 'publishing automation'. Imagine a personalised
hotel or travel brochure; an invoice; a management report with tables-of-contents, 12-column financial tables and custom charts mied in with a lot of words...so my requirements are more like "Illustrator
plus variable information" than "Report Designer". BUT, a classic
report designer would still be a great starting point. I can foresee
a project structure with several 'file types', including a different one for designing the page backgrounds.

Bottom line: anything that lets us visually position rectangles
and add new object types is a great start.

Yes, but you have to have already some pdf created!

Again, in our world often someone's design agency say "can you make this
dynamic?" It saves a lot of hours.

Have you seen my modifies made over pySketch? Can be a good point of start?
Now I'm ending the "TextObject" and the align/size functions.

I hand't heard of it but it sounds like just the starting point we want.

But when I try to run against the latest wxPython build on 2.4, it's
(a) missing "import sys" and (b) giving the error message below in errors.txt. Do I need the latest code from the repository?

Cheers,

Andy

(p.s. offline rest of today)

Traceback (most recent call last):
   File "C:\Python24\Lib\site-packages\pysketchapp\pySketch.py", line 2635, in ?
     main()
   File "C:\Python24\Lib\site-packages\pysketchapp\pySketch.py", line 2630, in main
     _app = SketchApp(0)
   File "C:\Python24\Lib\site-packages\wx-2.6-msw-unicode\wx\_core.py", line 7473, in __init__
     self._BootstrapApp()
   File "C:\Python24\Lib\site-packages\wx-2.6-msw-unicode\wx\_core.py", line 7125, in _BootstrapApp
     return _core_.PyApp__BootstrapApp(*args, **kwargs)
   File "C:\Python24\Lib\site-packages\pysketchapp\pySketch.py", line 2600, in OnInit
     frame = DrawingFrame(None, -1, "Untitled")
   File "C:\Python24\Lib\site-packages\pysketchapp\pySketch.py", line 185, in __init__
     self.toolsMenu.Append(menu_SELECT, "Selection", checkable=true)
   File "C:\Python24\Lib\site-packages\wx-2.6-msw-unicode\wx\_core.py", line 10206, in Append
     return _core_.Menu_Append(*args, **kwargs)
TypeError: 'checkable' is an invalid keyword argument for this function

But when I try to run against the latest wxPython build on 2.4, it's
(a) missing "import sys" and (b) giving the error message below in errors.txt. Do I need the latest code from the repository?

Excuse me everybody, I'm half asleep. I have picked up Erik Westra's one and probably have the wrong distro as I missed the start of the
thread. I'll try to find your modifications later today.

Best Regards,

Andy Robinson

Andy Robinson wrote:

I think that the idea of make the proprieties (I think you suppose something like size, color, font, position, etc... for the text )
into a side panel is good, but why not use the " classic
horizontal-bands"? How do you think to divide the logical paper
structure (header, text, footer, separators, etc..)?

Believe it or not, we have NEVER had a customer project which looked
anything like a database report.

Don't worry, I believe you :slight_smile: Surely you have more experience than mine
about reporting!

I would describe what we do as more like 'publishing automation'.
Imagine a personalised hotel or travel brochure; an invoice; a
management report with tables-of-contents, 12-column financial tables
and custom charts mied in with a lot of words...so my requirements
are more like "Illustrator plus variable information" than "Report
Designer".

Yes, this is not a problem, also because PySketch_2 has this function,
not the "band" function!

BUT, a classic report designer would still be a great starting point.
I can foresee a project structure with several 'file types',
including a different one for designing the page backgrounds.

Bottom line: anything that lets us visually position rectangles and
add new object types is a great start.

In my PySketch_2 I have different layers, so you can put the image
background on the bottom layer and the objects on the others, and can
use different page layout (size) and margins, so I think that is already
what you are looking for...

Yes, but you have to have already some pdf created!

Again, in our world often someone's design agency say "can you make
this dynamic?" It saves a lot of hours.

I haven't had any of this request, so for me this is a new thing, but I
believe you!

But now, I have to see how Sketch import the eps file for think to do
the same with PySketch_2

Have you seen my modifies made over pySketch? Can be a good point
of start? Now I'm ending the "TextObject" and the align/size
functions.

I hand't heard of it but it sounds like just the starting point we
want.

But when I try to run against the latest wxPython build on 2.4, it's (a) missing "import sys" and (b) giving the error message below in errors.txt. Do I need the latest code from the repository?

I think that you are using another version... Try this:
www.unipex.it/vario/PySketch_2.zip

Bye,
Michele

I think that you are using another version... Try this:
www.unipex.it/vario/PySketch_2.zip

It works! This is great, just what I needed. I'll have a play
over the weekend. Thanks

- Andy Robinson

Andy Robinson wrote:

Andreas Kaiser on our own list. We (in-house) and several of our
users have been on the lookout for a way to build a document-design tool
for some time.

It sounds like a cool project.

We have only played with wxPython, but we all prefer it
to the other Python GUI toolkits so far.

Us too. Good choice.

What we're looking for is not necessarily a classic horizontal-bands
database reporting tool, but rather a 'drawing program' into which
it's easy to plug new objects, and inspect their properties in a side
panel

Make sure to check out wx.lib.floatcanvas

So far, it's mostly designed to display stuff that has been programatically generated, but I've been working on adding more interactivity. In fact, I am hoping to use it as the basis for a tool for making Custom maps, which will require much of the functionality you also need.

Since the version that is in the wx.lib, I have added some more stuff, like auto-wrapped multi-line text boxes. Please let me know if you want the latest version.

It way well not be what you need, but there may be some ideas/code in there that you can borrow.

Another note: One piece of your project will be an engine to typeset text within the boxes you lay out in your document. This is not the least bit trivial. In an earlier thread, I suggested using TeX as the typesetting engine for such a tool, but embedding TeX is not the least bit trivial either. Perhaps ReportLab already has some typesetting code in it...I have no idea.

In any case, I'd love to suggest that whatever you do for the typesetting part, you build it as a distinct module that can be used by other projects..I know I'd love to use it!

I know wx gives you pretty limited access to font info (DC.GetTextExtent() is about it), so you'll probably need another way to access font info to do it right. Maybe this could help:

http://starship.python.net/crew/kernr/PyFT.html#

or

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov