[libreoffice-users] Re: Possible to write reports with relationship data?

2013-05-15 Thread Alexander Thurgood
Le 15/05/13 05:42, David Karr a écrit :

Hi David,

 If I have a main entity, and I have two one-to-many relationships to other
 tables (FK links from the other tables to the main table), is there any way
 to generate a report with the main table data, and the data for the other
 relationships also included (indented and formatted properly)?
 

Perhaps I'm misunderstanding here, but surely using a Query or a View
which pulls in the data from your 1-to-N tables, grouped as you want
them, as the basis for your report, would suffice ?


Alex


-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: Possible to write reports with relationship data?

2013-05-15 Thread David Karr
Let me give some example background to see if this can work.

Let's say we have an animals database, for someone maintaining an animal
shelter.  Each animal has a list of medical care events and also a list
of adoptions (some animals return to the shelter).  The
medicalCareEvents and adoptions tables each have a FK to the animals
table.

What I'm envisioning is a report that lists the fields for the animal,
followed by an indented section showing a row for each medical care event,
and another indented section showing adoptions for each animal.

A query could potentially use a join to create individual rows composed of
data from multiple tables, but that is really only practical for 1-1
relationships, or possibly 1-verysmallinteger relationships.

If you still think this can work, could you explain how this would be done?


On Wed, May 15, 2013 at 2:27 AM, Alexander Thurgood alex.thurg...@gmail.com
 wrote:

 Le 15/05/13 05:42, David Karr a écrit :

 Hi David,

  If I have a main entity, and I have two one-to-many relationships to
 other
  tables (FK links from the other tables to the main table), is there any
 way
  to generate a report with the main table data, and the data for the other
  relationships also included (indented and formatted properly)?
 

 Perhaps I'm misunderstanding here, but surely using a Query or a View
 which pulls in the data from your 1-to-N tables, grouped as you want
 them, as the basis for your report, would suffice ?


 Alex


 --
 To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
 Problems?
 http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
 Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
 List archive: http://listarchives.libreoffice.org/global/users/
 All messages sent to this list will be publicly archived and cannot be
 deleted



-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Re: Possible to write reports with relationship data?

2013-05-15 Thread Alexander Thurgood
Le 15/05/13 18:09, David Karr a écrit :

Hi David,

 No, I haven't gotten into that yet.  I assume I can do some sort of looping
 construct in writer that will allow me to step through rows in both the
 main table and the relationships tables?  Can I use Java or Javascript to
 do that iteration?

For iterative insertions of grouped data into a Writer document, the
mailmerge tool is often (ab)used :-) as the tool does this automatically
(well, it does, when it is working, which is LO version dependent ;-)).

If you base your mailmerge on a query (e.g. via a join) that fetches all
of your treatment entries for a given animal via the FK and orders them,
e.g. by date, then that should work.

What I haven't tried, is getting the results from two separate queries
into one single Writer documents, but in theory, this should work too. I
have been told, but again, not tried, that sections in documents can be
used to hold different queries, but I'm not sure whether the mailmerge
function would still work properly with this approach.


Alex


-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Re: Possible to write reports with relationship data?

2013-05-15 Thread Alexander Thurgood
Le 15/05/13 18:09, David Karr a écrit :

Me again.

 No, I haven't gotten into that yet.  I assume I can do some sort of looping
 construct in writer that will allow me to step through rows in both the
 main table and the relationships tables?  Can I use Java or Javascript to
 do that iteration?
 



This might give you an idea of the current situation :

http://forum.openoffice.org/en/forum/viewtopic.php?f=42t=36644p=168121hilit=two+queries+in+one+writer+document#p168121


Alex


-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Re: Possible to write reports with relationship data?

2013-05-15 Thread Alexander Thurgood
Le 15/05/13 18:09, David Karr a écrit :

This too, might help you along :

http://forum.openoffice.org/en/forum/viewtopic.php?f=13t=10865p=51051hilit=two+queries+in+one+writer+document#p51051

As I mentioned in a previous response, I'm really not sure about whether
you can insert two different query results at different places in a
single Writer (or Calc) document. My previous attempts over the years
all failed.

Ultimately, you might get further by using pyuno to create and
manipulate a Writer document, and insert the bits of data you want into
it. Again, the documentation here on how to engage in such an exercise
is sparse.


Alex



-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted