* Running reports from lua

Writing and using plugins for Version 5 and above.
Post Reply
avatar
shoshk
Diamond
Posts: 83
Joined: 13 May 2015 16:28
Family Historian: V6.2
Location: Ashkelon, Israel

Running reports from lua

Post by shoshk » 11 Sep 2019 19:57

I've tried looking for this and think that it probably doesn't exist, but I'll ask anyway...

Is it possible to run a report from a plugin?

I would like to be able to specify a list of individuals, in a named list, and generate a report for each individual, saving each separately.

Thanks,
Shoshana

User avatar
tatewise
Megastar
Posts: 16315
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Running reports from lua

Post by tatewise » 11 Sep 2019 21:25

You are correct; that is not possible from a Plugin, or in FH.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
shoshk
Diamond
Posts: 83
Joined: 13 May 2015 16:28
Family Historian: V6.2
Location: Ashkelon, Israel

Re: Running reports from lua

Post by shoshk » 12 Sep 2019 04:34

Thanks Mike

User avatar
Jane
Site Admin
Posts: 7698
Joined: 01 Nov 2002 15:00
Family Historian: V6.2
Location: Somerset, England
Contact:

Re: Running reports from lua

Post by Jane » 12 Sep 2019 07:52

If you don't mind having the reports in HTML format you could use the CD/Web tool to create all the reports.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
tatewise
Megastar
Posts: 16315
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Running reports from lua

Post by tatewise » 12 Sep 2019 08:42

Jane, do you mean the Plugin has to construct all the details required in the Report, or that somehow a standard FH Report can be produced that way?
I think the OP was hoping for the latter.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ColeValleyGirl
Megastar
Posts: 1240
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Running reports from lua

Post by ColeValleyGirl » 12 Sep 2019 08:53

I think Jane meant that you can define a website including the report wanted, and will end up with one html file per individual. No plugins involved. And if you have the right software, you can create pdf files in bulk from html files... (I won't recommend the programme I use because ti wasn't cheap).

User avatar
Jane
Site Admin
Posts: 7698
Joined: 01 Nov 2002 15:00
Family Historian: V6.2
Location: Somerset, England
Contact:

Re: Running reports from lua

Post by Jane » 12 Sep 2019 09:08

As Helen says my suggestion does not need any plugin code. Calibre can convert between most formats and comes at my favourite price . . . free.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
ColeValleyGirl
Megastar
Posts: 1240
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Running reports from lua

Post by ColeValleyGirl » 12 Sep 2019 09:13

Hadn't though of using Calibre -- it's an excellent suggestion.

avatar
shoshk
Diamond
Posts: 83
Joined: 13 May 2015 16:28
Family Historian: V6.2
Location: Ashkelon, Israel

Re: Running reports from lua

Post by shoshk » 12 Sep 2019 10:16

Thanks for everybody's input. I need to use a plugin to generate at least part of my reports because they are non-standard and require logic.

I plan on generating my output as a MS Word file. I've done this in the past and, while not trivial, gives me fine control over all aspects of content and formatting.

I was hoping that I could generate parts of each report from the plugin (e.g. a standard descendant report), save them in rtf format and plunk them into my word doc. It would save development time.

But, hey, I'm retired and no longer have to work according to somebody else's schedule. So it'll just take a bit longer to do.

BTW, for a while I was considering using John Cardinal's GedcomPublisher and converting the epub output to docx via Calibre but that didn't give me a solution for the sections which require logic.

Regards,
Shoshana

User avatar
ColeValleyGirl
Megastar
Posts: 1240
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Running reports from lua

Post by ColeValleyGirl » 12 Sep 2019 12:05

Some years ago, I wrote some code to splice elements from two different website generators into a set of output files organised/reordered in a way that made sense to me (also with some logic about including and excluding elements). It was a three-pass process: generate website A; generate website B; generate final website using elements from A and B and some custom content.

It wasn't done in Lua (predated plugins) but I did find it easier that writing everything from scratch; and I would do it in Lua today.

I then moved on to use John Cardinal's Gedsite, but have concluded its drawbacks outweigh its merits. So, on my ever expanding to-do list (luckily I'm retired as well) I shall be developing a plugin to generate my website but will probably take the cut-and-splice approach again. Or maybe not... Need to think about it a bit. Lua patterns aren't as powerful as Regexes, which is what I used to do the cut and splice.

User avatar
tatewise
Megastar
Posts: 16315
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Running reports from lua

Post by tatewise » 13 Sep 2019 09:43

To create MS Word documents from a Plugin see Knowledge Base > Word Load Data Direct Into (code snippet) but it is not straightforward.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
shoshk
Diamond
Posts: 83
Joined: 13 May 2015 16:28
Family Historian: V6.2
Location: Ashkelon, Israel

Re: Running reports from lua

Post by shoshk » 13 Sep 2019 09:48

Thank you Mike.

I've done this before. As you say, not straight-forward, but the results are worth the effort (in my opinion).

Shosh

Post Reply