Simplified report generation

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Simplified report generation

Don Allingham
I've been working on trying to simplify report generation. Obviously,
I'm attempting to make writing reports easier, so that more people would
be willing to do this.

The biggest issue is that accessing the database can be a bit confusing.
So I've created a simpler interface for basic reports. Not everything is
accessible in the simplified form, but what is should be much more
understandable.

Below is a sample of what a simple report would be that would print some
basic information about a person. The variable "self.person" is the
person that report is about. This is automatically set for you.

class MyReport( SimpleReport ):

   def run( self ):
      print "Person        : ", self.name( self.person )
      print "Birth date    : ", self.birth_date( self.person )
      print "Birth place   : ", self.birth_place( self.person )
      print "Death date    : ", self.death_date( self.person )
      print "Death place   : ", self.death_place( self.person )
      print "Father        : ", self.name( self.father(self.person ) )
      print "Mother        : ", self.name( self.mother(self.person ) )
      print "Spouse        : ", self.name( self.spouse(self.person ) )
      print "Marriage Type : ", self.marriage_type( self.person )
      print "Marriage Date : ", self.marriage_date( self.person )
      print "Marriage Place: ", self.marriage_place( self.person )

      for child in self.children( self.person ):
         print "Child         : ", self.name( child )

The output of this report would look something like:

Person        :  Garner, Lewis Anderson
Birth date    :  6/21/1855
Birth place   :  Great Falls, MT
Death date    :  6/28/1911
Death place   :  Twin Falls, ID
Father        :  Garner, Robert W.
Mother        :  Zieliński, Phoebe Emily
Spouse        :  Martel, Luella Jacques
Marriage Type :  Married
Marriage Date :  4/1/1875
Marriage Place:  Paragould, AR
Child         :  Garner, Eugene Stanley
Child         :  Garner, Jesse V.
Child         :  Garner, Raymond E.
Child         :  Garner, Jennie S.
Child         :  Garner, Walter E.
Child         :  Garner, Daniel Webster
Child         :  Garner, Bertha P.
Child         :  Garner, Elizabeth

So, to get the name of a person, you call:

   self.name( person )

To get the marriage date of the person (the primary marriage, if more
than one)

   self.marriage_date( person )

So, hopefully, this will make things easier.

Don


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Simplified report generation

bm-5
Hi,

I like this idea.
However, I find the naming a bit confusing as it has not really something todo
with the Report class and such, or is it your idea to add this, so we can
derive from SimpleReport instead of from Report?

I would advocate to call it more something like SimpleAccess, which you
can use
in a report derived from Report, so you can do:

class MyReport( Report ):
  def write_report(self):
       .....
       sa = SimpleAccess(personhandle)
       print "Person        : ", sa.name( )
       print "Father        : ", sa.name( sa.father() )
       ....
I would allow to pass no argument means using the self.person of sa.

As to people using this. My impression with writing reports is that the hard
part is getting to the correct event/peron/place. Once you have it, printing
out data is straithforward (once you know the attributes).
So although this class would enable to make the printing out more easy,
the hard
part of selecting the data you want (filter, ....) does not change.

As an aside, it would be nice to have such an access to family, event, place
too, so it would be nice to extend this to having SimpleAccessPerson,
SimpleAccessPlace, SimpleAccessEvent.

Benny

Quoting Don Allingham <[hidden email]>:

> I've been working on trying to simplify report generation. Obviously,
> I'm attempting to make writing reports easier, so that more people would
> be willing to do this.
>
> The biggest issue is that accessing the database can be a bit confusing.
> So I've created a simpler interface for basic reports. Not everything is
> accessible in the simplified form, but what is should be much more
> understandable.
>
> Below is a sample of what a simple report would be that would print some
> basic information about a person. The variable "self.person" is the
> person that report is about. This is automatically set for you.
>
> class MyReport( SimpleReport ):
>
>   def run( self ):
>      print "Person        : ", self.name( self.person )
>      print "Birth date    : ", self.birth_date( self.person )
>      print "Birth place   : ", self.birth_place( self.person )
>      print "Death date    : ", self.death_date( self.person )
>      print "Death place   : ", self.death_place( self.person )
>      print "Father        : ", self.name( self.father(self.person ) )
>      print "Mother        : ", self.name( self.mother(self.person ) )
>      print "Spouse        : ", self.name( self.spouse(self.person ) )
>      print "Marriage Type : ", self.marriage_type( self.person )
>      print "Marriage Date : ", self.marriage_date( self.person )
>      print "Marriage Place: ", self.marriage_place( self.person )
>
>      for child in self.children( self.person ):
>         print "Child         : ", self.name( child )
>
> The output of this report would look something like:
>
> Person        :  Garner, Lewis Anderson
> Birth date    :  6/21/1855
> Birth place   :  Great Falls, MT
> Death date    :  6/28/1911
> Death place   :  Twin Falls, ID
> Father        :  Garner, Robert W.
> Mother        :  Zieli?ski, Phoebe Emily
> Spouse        :  Martel, Luella Jacques
> Marriage Type :  Married
> Marriage Date :  4/1/1875
> Marriage Place:  Paragould, AR
> Child         :  Garner, Eugene Stanley
> Child         :  Garner, Jesse V.
> Child         :  Garner, Raymond E.
> Child         :  Garner, Jennie S.
> Child         :  Garner, Walter E.
> Child         :  Garner, Daniel Webster
> Child         :  Garner, Bertha P.
> Child         :  Garner, Elizabeth
>
> So, to get the name of a person, you call:
>
>   self.name( person )
>
> To get the marriage date of the person (the primary marriage, if more
> than one)
>
>   self.marriage_date( person )
>
> So, hopefully, this will make things easier.
>
> Don
>
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: Simplified report generation

Douglas S. Blank
In reply to this post by Don Allingham
Don,

I very much appreciate the work in trying to make report writing easier.
Some points:

1) Let's just make this part of the regular base report class; any easy
access changes should be available to experts and newbies alike.

2) Rather than creating a method for each easy data element, why not put
all of this in a dictionary? Then you could effectively have the same
output below with less code:

person = self.getPersonData()
for key in person:
   print key, person[key]

3) I like anything that hides the handles. Perhaps a dictionary could have
some structure:

data = self.getData()
print data["person"]["name"]
# or
for key in data["person"]:
   print key, person[key]

for child in data["children"]:
   print child["name"]

4) Consider including the simplified GUI report options interface that I
added to plugins/Calendar.py. (It is currently broken for 2.3, I think).
Or, if there are issues, let me know and I can refine it. It really helps
in dealing with the creation and access of the options.

[The method approach does allow parameters for each item. For example, I
know that I'd like to pass "%l, %f (%c)" to self.name...]

-Doug

On Fri, April 27, 2007 12:22 am, Don Allingham wrote:

> I've been working on trying to simplify report generation. Obviously,
> I'm attempting to make writing reports easier, so that more people would
> be willing to do this.
>
> The biggest issue is that accessing the database can be a bit confusing.
> So I've created a simpler interface for basic reports. Not everything is
> accessible in the simplified form, but what is should be much more
> understandable.
>
> Below is a sample of what a simple report would be that would print some
> basic information about a person. The variable "self.person" is the
> person that report is about. This is automatically set for you.
>
> class MyReport( SimpleReport ):
>
>    def run( self ):
>       print "Person        : ", self.name( self.person )
>       print "Birth date    : ", self.birth_date( self.person )
>       print "Birth place   : ", self.birth_place( self.person )
>       print "Death date    : ", self.death_date( self.person )
>       print "Death place   : ", self.death_place( self.person )
>       print "Father        : ", self.name( self.father(self.person ) )
>       print "Mother        : ", self.name( self.mother(self.person ) )
>       print "Spouse        : ", self.name( self.spouse(self.person ) )
>       print "Marriage Type : ", self.marriage_type( self.person )
>       print "Marriage Date : ", self.marriage_date( self.person )
>       print "Marriage Place: ", self.marriage_place( self.person )
>
>       for child in self.children( self.person ):
>          print "Child         : ", self.name( child )
>
> The output of this report would look something like:
>
> Person        :  Garner, Lewis Anderson
> Birth date    :  6/21/1855
> Birth place   :  Great Falls, MT
> Death date    :  6/28/1911
> Death place   :  Twin Falls, ID
> Father        :  Garner, Robert W.
> Mother        :  Zieliński, Phoebe Emily
> Spouse        :  Martel, Luella Jacques
> Marriage Type :  Married
> Marriage Date :  4/1/1875
> Marriage Place:  Paragould, AR
> Child         :  Garner, Eugene Stanley
> Child         :  Garner, Jesse V.
> Child         :  Garner, Raymond E.
> Child         :  Garner, Jennie S.
> Child         :  Garner, Walter E.
> Child         :  Garner, Daniel Webster
> Child         :  Garner, Bertha P.
> Child         :  Garner, Elizabeth
>
> So, to get the name of a person, you call:
>
>    self.name( person )
>
> To get the marriage date of the person (the primary marriage, if more
> than one)
>
>    self.marriage_date( person )
>
> So, hopefully, this will make things easier.
>
> Don
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/_______________________________________________
> Gramps-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>


--
Douglas S. Blank
Associate Professor, Bryn Mawr College
http://cs.brynmawr.edu/~dblank/
Office: 610 526 6501

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: Simplified report generation

bm-5
Doug,

I think you underestimate the time needed to fill up the dictionary.
With methods, only the database access is done the report needs. With a
dictionary you have to get all possible data people might need on init.

Benny

Quoting "Douglas S. Blank" <[hidden email]>:

> Don,
>
> I very much appreciate the work in trying to make report writing easier.
> Some points:
>
> 1) Let's just make this part of the regular base report class; any easy
> access changes should be available to experts and newbies alike.
>
> 2) Rather than creating a method for each easy data element, why not put
> all of this in a dictionary? Then you could effectively have the same
> output below with less code:
>
> person = self.getPersonData()
> for key in person:
>   print key, person[key]
>
> 3) I like anything that hides the handles. Perhaps a dictionary could hav
e

> some structure:
>
> data = self.getData()
> print data["person"]["name"]
> # or
> for key in data["person"]:
>   print key, person[key]
>
> for child in data["children"]:
>   print child["name"]
>
> 4) Consider including the simplified GUI report options interface that I
> added to plugins/Calendar.py. (It is currently broken for 2.3, I think).
> Or, if there are issues, let me know and I can refine it. It really helps
> in dealing with the creation and access of the options.
>
> [The method approach does allow parameters for each item. For example, I
> know that I'd like to pass "%l, %f (%c)" to self.name...]
>
> -Doug
>
> On Fri, April 27, 2007 12:22 am, Don Allingham wrote:
>> I've been working on trying to simplify report generation. Obviously,
>> I'm attempting to make writing reports easier, so that more people would
>> be willing to do this.
>>
>> The biggest issue is that accessing the database can be a bit confusing.
>> So I've created a simpler interface for basic reports. Not everything is
>> accessible in the simplified form, but what is should be much more
>> understandable.
>>
>> Below is a sample of what a simple report would be that would print some
>> basic information about a person. The variable "self.person" is the
>> person that report is about. This is automatically set for you.
>>
>> class MyReport( SimpleReport ):
>>
>>    def run( self ):
>>       print "Person        : ", self.name( self.person )
>>       print "Birth date    : ", self.birth_date( self.person )
>>       print "Birth place   : ", self.birth_place( self.person )
>>       print "Death date    : ", self.death_date( self.person )
>>       print "Death place   : ", self.death_place( self.person )
>>       print "Father        : ", self.name( self.father(self.person ) )
>>       print "Mother        : ", self.name( self.mother(self.person ) )
>>       print "Spouse        : ", self.name( self.spouse(self.person ) )
>>       print "Marriage Type : ", self.marriage_type( self.person )
>>       print "Marriage Date : ", self.marriage_date( self.person )
>>       print "Marriage Place: ", self.marriage_place( self.person )
>>
>>       for child in self.children( self.person ):
>>          print "Child         : ", self.name( child )
>>
>> The output of this report would look something like:
>>
>> Person        :  Garner, Lewis Anderson
>> Birth date    :  6/21/1855
>> Birth place   :  Great Falls, MT
>> Death date    :  6/28/1911
>> Death place   :  Twin Falls, ID
>> Father        :  Garner, Robert W.
>> Mother        :  Zieliński, Phoebe Emily
>> Spouse        :  Martel, Luella Jacques
>> Marriage Type :  Married
>> Marriage Date :  4/1/1875
>> Marriage Place:  Paragould, AR
>> Child         :  Garner, Eugene Stanley
>> Child         :  Garner, Jesse V.
>> Child         :  Garner, Raymond E.
>> Child         :  Garner, Jennie S.
>> Child         :  Garner, Walter E.
>> Child         :  Garner, Daniel Webster
>> Child         :  Garner, Bertha P.
>> Child         :  Garner, Elizabeth
>>
>> So, to get the name of a person, you call:
>>
>>    self.name( person )
>>
>> To get the marriage date of the person (the primary marriage, if more
>> than one)
>>
>>    self.marriage_date( person )
>>
>> So, hopefully, this will make things easier.
>>
>> Don
>>
>> ------------------------------------------------------------------------
-
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/____________________________________
___________

>> Gramps-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>>
>
>
> --
> Douglas S. Blank
> Associate Professor, Bryn Mawr College
> http://cs.brynmawr.edu/~dblank/
> Office: 610 526 6501
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gramps-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: Simplified report generation

Douglas S. Blank

On Fri, April 27, 2007 9:42 am, [hidden email] wrote:
> Doug,
>
> I think you underestimate the time needed to fill up the dictionary.
> With methods, only the database access is done the report needs. With a
> dictionary you have to get all possible data people might need on init.

True. But three points:

1. It could be a pseudo-dictionary where items are only computed when
accessed.

2. I would willingly trade time and space for a drop-dead easy interface
in the reports.

3. I'm not sure I like the dictionary interface either, because of the
lack of ability to fine-tune each element (like getting the name in a way
that I like). BTW, we would use self.name(format="surname, given (call)")
with the new, easy to use NameDisplay... this would be TOO easy :)

Just thought we should explore the alternatives... Perhaps person, place,
source, etc. should all be objects with properties:

self.person.name
self.person.age
self.place.name

These could all be properties such that they are not computed until
needed, but don't even require a method and variable to get; they are just
there waiting to be used. That would change Don's code to:

>>>    def run( self ):
>>>       print "Person        : ", self.person.name
>>>       print "Birth date    : ", self.person.birth_date
>>>       print "Birth place   : ", self.person.birth_place
>>>       print "Death date    : ", self.person.death_date
>>>       print "Death place   : ", self.person.death_place
>>>       print "Father        : ", self.person.father.name
>>>       print "Mother        : ", self.person.mother.name
>>>       print "Spouse        : ", self.person.spouse.name
>>>       print "Marriage Type : ", self.person.marriage_type
>>>       print "Marriage Date : ", self.person.marriage_date
>>>       print "Marriage Place: ", self.person.marriage_place
>>>
>>>       for child in self.person.children:
>>>          print "Child         : ", child.name

One could make them both properties and callable, so that
self.person.name("last, first (call)") would also work.

-Doug

> Benny
>
> Quoting "Douglas S. Blank" <[hidden email]>:
>
>> Don,
>>
>> I very much appreciate the work in trying to make report writing easier.
>> Some points:
>>
>> 1) Let's just make this part of the regular base report class; any easy
>> access changes should be available to experts and newbies alike.
>>
>> 2) Rather than creating a method for each easy data element, why not put
>> all of this in a dictionary? Then you could effectively have the same
>> output below with less code:
>>
>> person = self.getPersonData()
>> for key in person:
>>   print key, person[key]
>>
>> 3) I like anything that hides the handles. Perhaps a dictionary could
>> hav
> e
>> some structure:
>>
>> data = self.getData()
>> print data["person"]["name"]
>> # or
>> for key in data["person"]:
>>   print key, person[key]
>>
>> for child in data["children"]:
>>   print child["name"]
>>
>> 4) Consider including the simplified GUI report options interface that I
>> added to plugins/Calendar.py. (It is currently broken for 2.3, I think).
>> Or, if there are issues, let me know and I can refine it. It really
>> helps
>> in dealing with the creation and access of the options.
>>
>> [The method approach does allow parameters for each item. For example, I
>> know that I'd like to pass "%l, %f (%c)" to self.name...]
>>
>> -Doug
>>
>> On Fri, April 27, 2007 12:22 am, Don Allingham wrote:
>>> I've been working on trying to simplify report generation. Obviously,
>>> I'm attempting to make writing reports easier, so that more people
>>> would
>>> be willing to do this.
>>>
>>> The biggest issue is that accessing the database can be a bit
>>> confusing.
>>> So I've created a simpler interface for basic reports. Not everything
>>> is
>>> accessible in the simplified form, but what is should be much more
>>> understandable.
>>>
>>> Below is a sample of what a simple report would be that would print
>>> some
>>> basic information about a person. The variable "self.person" is the
>>> person that report is about. This is automatically set for you.
>>>
>>> class MyReport( SimpleReport ):
>>>
>>>    def run( self ):
>>>       print "Person        : ", self.name( self.person )
>>>       print "Birth date    : ", self.birth_date( self.person )
>>>       print "Birth place   : ", self.birth_place( self.person )
>>>       print "Death date    : ", self.death_date( self.person )
>>>       print "Death place   : ", self.death_place( self.person )
>>>       print "Father        : ", self.name( self.father(self.person ) )
>>>       print "Mother        : ", self.name( self.mother(self.person ) )
>>>       print "Spouse        : ", self.name( self.spouse(self.person ) )
>>>       print "Marriage Type : ", self.marriage_type( self.person )
>>>       print "Marriage Date : ", self.marriage_date( self.person )
>>>       print "Marriage Place: ", self.marriage_place( self.person )
>>>
>>>       for child in self.children( self.person ):
>>>          print "Child         : ", self.name( child )
>>>
>>> The output of this report would look something like:
>>>
>>> Person        :  Garner, Lewis Anderson
>>> Birth date    :  6/21/1855
>>> Birth place   :  Great Falls, MT
>>> Death date    :  6/28/1911
>>> Death place   :  Twin Falls, ID
>>> Father        :  Garner, Robert W.
>>> Mother        :  Zieliński, Phoebe Emily
>>> Spouse        :  Martel, Luella Jacques
>>> Marriage Type :  Married
>>> Marriage Date :  4/1/1875
>>> Marriage Place:  Paragould, AR
>>> Child         :  Garner, Eugene Stanley
>>> Child         :  Garner, Jesse V.
>>> Child         :  Garner, Raymond E.
>>> Child         :  Garner, Jennie S.
>>> Child         :  Garner, Walter E.
>>> Child         :  Garner, Daniel Webster
>>> Child         :  Garner, Bertha P.
>>> Child         :  Garner, Elizabeth
>>>
>>> So, to get the name of a person, you call:
>>>
>>>    self.name( person )
>>>
>>> To get the marriage date of the person (the primary marriage, if more
>>> than one)
>>>
>>>    self.marriage_date( person )
>>>
>>> So, hopefully, this will make things easier.
>>>
>>> Don
>>>
>>> ------------------------------------------------------------------------
> -
>>> This SF.net email is sponsored by DB2 Express
>>> Download DB2 Express C - the FREE version of DB2 express and take
>>> control of your XML. No limits. Just data. Click to get it now.
>>> http://sourceforge.net/powerbar/db2/____________________________________
> ___________
>>> Gramps-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>>>
>>
>>
>> --
>> Douglas S. Blank
>> Associate Professor, Bryn Mawr College
>> http://cs.brynmawr.edu/~dblank/
>> Office: 610 526 6501
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> Gramps-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>>
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gramps-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>


--
Douglas S. Blank
Associate Professor, Bryn Mawr College
http://cs.brynmawr.edu/~dblank/
Office: 610 526 6501

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: Simplified report generation

Brian Matherly
In reply to this post by Don Allingham
Don,

>The biggest issue is that accessing the database can be a bit confusing.
>So I've created a simpler interface for basic reports.

I disagree. I've worked on plenty of reports and helped other people develop new ones. From what I've seen, people can understand the database access relatively easy by looking at other reports as examples (and the tutorial on the Wiki is quite good).

The difficulties, as I see it, are:
1) Layout (expecially with graphical reports like the calendar).
2) Adding user options and understanding how those options are handled by the report system.
3) Understanding the general report structure and what functionality is already inherited from base classes.

A lot of magic happens behind the scenes, and in my opinion, the API could be improved to make things seem less magical. For example, how is a user who is writing a text report supposed to know that he can't use the "draw_text()" function inherited from BaseDoc()?

I don't think much can or needs to be done for #1. That's the heart of a report - presenting data in a user friendly layout.
I believe I have made some progress already on #2 and #3 by simply reducing the amount of functionality that is inherited from base classes (Particularly Report and BaseDoc).

This whole topic has been my inspiration for improvement in the 2.3
branch. I wrote a little about it on the Blog:
http://blog.gramps-project.org/?p=53

In summary, I don't think your time is being wasted, but I also don't think you get the largest benefit possible from your effort.

Feel free to disagree :)

~Brian


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: Simplified report generation

bm-5
Brian has a point.

On the other hand, there probably is a desire to make a quick report with a
custom layout, and if offered users might use it.
For this two things are needed: easy layout, which Brian has been working on.
Next, easy retrieval of data, to which this class can help.

So, offering this type of class will increase the ease of making
a simple report, but only as Brian says if it is combined with easy well
understandable layout classes.

I don't think normal users are interested much in report options, at least not
at the beginning.
I would suggest making a few simple reports with no options (starting from
active person), group them under user reports, and show in tutorial on how to
change them (change layout, print extra data).

Whatever is done, enough complexity must be accessible.
In attachment a report I got as generated with the Aldfaer program from
a fellow
genealogist (in dutch, but should be clear it starts at active person and
prints the descendants in a certain layout and a specific numbering).

I see three issues that must be available to make reporting easy, and allow a
user to do this:

1/selection of data. Some logic is always needed. Some programming skills are
needed
2/layout. How to produce quickly this layout in a report
3/data printing. how to feed the data to the layout.

This class of Don provides easy 2/, the layout classes of Brian should provide
easy 2/, however, the user that is capable of doing 1/ probably has no
need for
easy 2/ or 3/.

Benny


Quoting Brian Matherly <[hidden email]>:

> Don,
>
>> The biggest issue is that accessing the database can be a bit confusing.
>> So I've created a simpler interface for basic reports.
>
> I disagree. I've worked on plenty of reports and helped other people
> develop new ones. From what I've seen, people can understand the
> database access relatively easy by looking at other reports as
> examples (and the tutorial on the Wiki is quite good).
>
> The difficulties, as I see it, are:
> 1) Layout (expecially with graphical reports like the calendar).
> 2) Adding user options and understanding how those options are
> handled by the report system.
> 3) Understanding the general report structure and what functionality
> is already inherited from base classes.
>
> A lot of magic happens behind the scenes, and in my opinion, the API
> could be improved to make things seem less magical. For example, how
> is a user who is writing a text report supposed to know that he can't
> use the "draw_text()" function inherited from BaseDoc()?
>
> I don't think much can or needs to be done for #1. That's the heart
> of a report - presenting data in a user friendly layout.
> I believe I have made some progress already on #2 and #3 by simply
> reducing the amount of functionality that is inherited from base
> classes (Particularly Report and BaseDoc).
>
> This whole topic has been my inspiration for improvement in the 2.3
> branch. I wrote a little about it on the Blog:
> http://blog.gramps-project.org/?p=53
>
> In summary, I don't think your time is being wasted, but I also don't
> think you get the largest benefit possible from your effort.
>
> Feel free to disagree :)
>
> ~Brian
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gramps-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Parenteel van Pierre Jean Malengier.rtf (19K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Simplified report generation

Stéphane Charette-2
In reply to this post by Brian Matherly
> 3) Understanding the general report structure and what functionality is
>already inherited from base classes.

As someone who has recently been playing around in NarrativeWeb, and
who has written a brand new report (FamilyLines.py), I think this was
-- and still is -- the hardest part to comprehend.

There are some methods (are they called methods in Python?) and
members which exist in the base classes which reports must override.
There are others that optionally can be overriden.  But many of these
are not well documented.  I still don't understand what some of these
do, and why I would or wouldn't want to use them.

The biggest bang-for-the-buck from my perspective would be to better
document what we already have.

Stéphane

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: Simplified report generation

Don Allingham
In reply to this post by Brian Matherly
Yes, I know that these are problems with the current report system.
However, I don't need to tackle them, because you already are :-)

The Database API can be a bit much for a lot of users. For example, to
get the birth date of a person, you need to do the following:

ref = db.get_birth_ref(person)
if ref:
   event_handle = ref.get_reference_handle()
   if event_handle:
      event = db.get_event_from_handle(event_handle)
      date_obj = event.get_date_object()
      if date_obj:
         date_str = DateHandler.displayer.display(date_obj)
else:
   date_str = u''

I think that "self.birth_date(person)" is easier. :-)

But in all reality, a major ulterior motive behind this new, abbreviated
syntax is to make it easier to port LifeLines reports to GRAMPS.

Don



On Fri, 2007-04-27 at 08:54 -0700, Brian Matherly wrote:

> Don,
>
> >The biggest issue is that accessing the database can be a bit confusing.
> >So I've created a simpler interface for basic reports.
>
> I disagree. I've worked on plenty of reports and helped other people develop new ones. From what I've seen, people can understand the database access relatively easy by looking at other reports as examples (and the tutorial on the Wiki is quite good).
>
> The difficulties, as I see it, are:
> 1) Layout (expecially with graphical reports like the calendar).
> 2) Adding user options and understanding how those options are handled by the report system.
> 3) Understanding the general report structure and what functionality is already inherited from base classes.
>
> A lot of magic happens behind the scenes, and in my opinion, the API could be improved to make things seem less magical. For example, how is a user who is writing a text report supposed to know that he can't use the "draw_text()" function inherited from BaseDoc()?
>
> I don't think much can or needs to be done for #1. That's the heart of a report - presenting data in a user friendly layout.
> I believe I have made some progress already on #2 and #3 by simply reducing the amount of functionality that is inherited from base classes (Particularly Report and BaseDoc).
>
> This whole topic has been my inspiration for improvement in the 2.3
> branch. I wrote a little about it on the Blog:
> http://blog.gramps-project.org/?p=53
>
> In summary, I don't think your time is being wasted, but I also don't think you get the largest benefit possible from your effort.
>
> Feel free to disagree :)
>
> ~Brian
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel

signature.asc (198 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Simplified report generation

Brian Matherly
In reply to this post by Don Allingham
Doug,

>4) Consider including the simplified GUI report options interface that I
>added to plugins/Calendar.py. (It is currently broken for 2.3, I think).
>Or, if there are issues, let me know and I can refine it. It really helps
>in dealing with the creation and access of the options.

I'm taking some hints from your report and hope to make some improvements before the next release. Input is welcome.

~Brian



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: Simplified report generation

jerome
In reply to this post by Don Allingham
> But in all reality, a major ulterior motive behind this new, abbreviated
> syntax is to make it easier to port LifeLines reports to GRAMPS.

Some months ago, I made (tests) with hrReportMaker
http://sourceforge.net/projects/hrreportmaker/

Program translates LifeLine into python. I may send a
hrReportMaker.tar.gz, you need to have Yapps2
http://theory.stanford.edu/~amitp/yapps/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel