Page 1 of 1

Running reports from lua

Posted: 11 Sep 2019 19:57
by shoshk
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

Re: Running reports from lua

Posted: 11 Sep 2019 21:25
by tatewise
You are correct; that is not possible from a Plugin, or in FH.

Re: Running reports from lua

Posted: 12 Sep 2019 04:34
by shoshk
Thanks Mike

Re: Running reports from lua

Posted: 12 Sep 2019 07:52
by Jane
If you don't mind having the reports in HTML format you could use the CD/Web tool to create all the reports.

Re: Running reports from lua

Posted: 12 Sep 2019 08:42
by tatewise
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.

Re: Running reports from lua

Posted: 12 Sep 2019 08:53
by ColeValleyGirl
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).

Re: Running reports from lua

Posted: 12 Sep 2019 09:08
by Jane
As Helen says my suggestion does not need any plugin code. Calibre can convert between most formats and comes at my favourite price . . . free.

Re: Running reports from lua

Posted: 12 Sep 2019 09:13
by ColeValleyGirl
Hadn't though of using Calibre -- it's an excellent suggestion.

Re: Running reports from lua

Posted: 12 Sep 2019 10:16
by shoshk
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

Re: Running reports from lua

Posted: 12 Sep 2019 12:05
by ColeValleyGirl
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.

Re: Running reports from lua

Posted: 13 Sep 2019 09:43
by tatewise
To create MS Word documents from a Plugin see Knowledge Base > Word Load Data Direct Into (code snippet) but it is not straightforward.

Re: Running reports from lua

Posted: 13 Sep 2019 09:48
by shoshk
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