Andreas Kaiser wrote:
Hi Michele,
Michele Petrazzo schrieb:
Other idea that now jump into my mind is to modify my PySketch_2
for make a report designer for the engine posted by Ricardo.
What do you think?
I've played with your pysketch2. Following point are remarkable:
1. Draw an easy sketch, esp. textObjects. 2. Name the textObjects.
Yes.I'll do it in the next free time, with also the align and size (like
to the smallest, to the largest) of the objs
3. Save the file.
But pysketch2 already save the file! or you mean save into xml?
4. At line 1989 (in loadContents):
for layer, type, data in objData: print data if data[23] == 'Text0':
#This is the name of my textObject data[16] = u'Andreas' # change the
content obj = DrawingObject(type, layer=layer) obj.setData(data) self.Contents[layer].append(obj) self.__objCounter[type] +=1
I think that a new object type, like you say (textObjects) is the better
solution!
5. Voila, it works!
With pysketch we can preview, setup, print only with wxPython. So I think, there is a way to separate pysketch in a designer part
(already done ;-))) and a control for embedding in the wxPython app.
The control has only the load, preview, setup, print functions.
Yes, I think the same. But what do you think about the integration of
Ricardo code for preview and other functions?
However I have to split pysketch2 into some class, because I use the
same code for another draw application, so they will be more specialized
classes and the code will be more simply reusable (also for the
functions that you mentioned if we don't decide to use Ricardo's code)
Questions: What about the core function for reporting DB-tables? How
can we made this?
Good question! I haven't a big experience about print of data became
from a db! I have experience with another printing framework that I use,
not develop, but it's closely connected to its db-data (that is a thing
that I, and I hope you, not want to do)
I think that the solution used by reportman is that we could try to use,
so leave to the user create the data file that, after, the framework can
read.
Logical example:
designer part:
-create some bands: header, text1, text2, footer (random names)
-header's field names: title, date
-text1's field names: name, surname, image
-text2's field names: bill,month ( restaurants bill for this year )
-footer_user's field names: total(a formula that calculate the bill
sum for this user)
-footer's field names: total (a formula that calculate the bill sum)
external application part:
-do some query, do some work, do number calculation (or not?)
-create a xml file (or csv file) like:
-header;title=Print for example;data=2006
-text1;name=Michele;surname=Petrazzo;image=base64 encoding image
-text2;bill=200,month=01
-text2;bill=200,month=02
-text2;bill=200,month=03
-footer_user;
-text1;name=OtherName;surname=OtherSurname;image=base64 encoding image
-footer_user;
-footer;
preview part:
-read the data passed into the command line (for a stand-alone print
application) or from the data passed by python code
-Start the preview, drawing the data with the instruction passed by the
caller. Pay attention if into the report the user want to make some
calculations at preview time (the sum for example)
-Finally print, if the user want!
Do you like this like starting idea?
What about page breaks?
No problems! With the printout derived class, we can do what we want!
Into th
For the moment, I will play around with the pysketch solution.
Tell me if you have other ideas! (or code, of course!)
Andreas
Michele