Mail merge document from current row & generate pdf from it?

Getting your data onto paper - or the web - Discussing the reports features of Base
Post Reply
WinstonSmith
Posts: 7
Joined: Tue Jul 16, 2013 4:28 am

Mail merge document from current row & generate pdf from it?

Post by WinstonSmith »

Greetings all!

I'm building a project in Base to generate and manage loan documents. I've done similar projects in Access but they were a long time ago and this one has a twist.

I have a form/subform which includes customer data in the main form and loan data in the subform. I would like the user to click a button on the form, which takes the currently displayed data, and generates a loan agreement based on a template Text document. Then, save the merged document as a pdf, and store the pdf as a pathname and/or in the database as a blob or other suitable object. Questions: 1) is this possible and 2) can the process be automated? I'd like to avoid having the user interact with the mail merge wizard etc. The template is over a dozen pages and includes an embedded spreadsheet amortization table (that's another story for now). Looking for suggestions and guidance on how best to approach this in Base.

Thanks,
Russ
OO/LO BASE aficionado
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: Mail merge document from current row & generate pdf from

Post by F3K Total »

Hello,
WinstonSmith wrote:1) is this possible
Yes
WinstonSmith wrote:2) can the process be automated?
Yes, by code.
R
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Mail merge document from current row & generate pdf from

Post by Villeroy »

Without any macro coding it might be possible to do with "power filtering" (search this forum) and with Calc (not as beautiful as Writer but more flexible).
The filtered form's push button opens a Calc document with one or more import ranges bound to something like:
SELECT this, that, other FROM data, filter WHERE id=filter.id and filter.row=0
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: Mail merge document from current row & generate pdf from

Post by F3K Total »

Hi,
WinstonSmith wrote:the user to click a button on the form,
  1. which takes the currently displayed data,
  2. and generates a loan agreement based on a template Text document.
  3. Then, save the merged document as a pdf,
  4. and store the pdf as a pathname and/or in the database as a blob or other suitable object.

Steps 1 and 2 can be done, as Villeroy wrote, without a makro, by pushing one buttton.
If you'd like to have done step 1 to 4 by pushing one button, you need code, and that's how i understood your question.
R
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
WinstonSmith
Posts: 7
Joined: Tue Jul 16, 2013 4:28 am

Re: Mail merge document from current row & generate pdf from

Post by WinstonSmith »

F3K Total wrote:Hi,
WinstonSmith wrote:the user to click a button on the form,
  1. which takes the currently displayed data,
  2. and generates a loan agreement based on a template Text document.
  3. Then, save the merged document as a pdf,
  4. and store the pdf as a pathname and/or in the database as a blob or other suitable object.

Steps 1 and 2 can be done, as Villeroy wrote, without a makro, by pushing one buttton.
If you'd like to have done step 1 to 4 by pushing one button, you need code, and that's how i understood your question.
R
Thanks for the responses. My thought was that entire process be automated. Where can I find examples of OO Basic code and/or learn how to accomplish these steps?
OO/LO BASE aficionado
Post Reply