[Solved] Open Writer doc with database fields for a letter

Discuss the database features
Post Reply
Shuttleu
Posts: 3
Joined: Thu Apr 02, 2015 12:11 am

[Solved] Open Writer doc with database fields for a letter

Post by Shuttleu »

Hello.

I have just started using OO (been using Microsoft Office for years) and I have hit a bit of a wall.

I have a Base database with a single table, this single table has simple info in it (name, address, etc.). I have a form which allows me to view and edit this info.
All well and good so far.

My problem is when I try to use the information from the database in a letter.
I have written a letter in Writer, selected the fields to use from "Data Sources (F4)" and when I choose to print, I then select the rows to use and print them.
What I want to do is, from the form in Base, press a button, it opens the Writer file and when I press print it just prints the row that I was on in Base.

I dont want to have to select the rows to print when I press print, I want it to print the row that I was viewing/editing.

Is this possible?
Last edited by Shuttleu on Fri Apr 03, 2015 11:46 pm, edited 1 time in total.
OpenOffice 4.1.1 on Mac OS X
dreamquartz
Posts: 881
Joined: Mon May 30, 2011 4:02 am

Re: Open Writer doc with database fields for a letter

Post by dreamquartz »

You might want to look at: viewtopic.php?f=13&t=75488.
This info helped me with both business cards and letters.

Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.
Shuttleu
Posts: 3
Joined: Thu Apr 02, 2015 12:11 am

Re: Open Writer doc with database fields for a letter

Post by Shuttleu »

dreamquartz wrote:You might want to look at: viewtopic.php?f=13&t=75488.
This info helped me with both business cards and letters.

Dream
Thats not quite what I was after, looking at that, they are talking about printing multiple letters at once with proceeding records.

What I'm after is the following.

I am on my form, I am editing record #25.
I press a button on my form which opens a Writer document with information from record #25 taken straight from the database.
OpenOffice 4.1.1 on Mac OS X
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: Open Writer doc with database fields for a letter

Post by F3K Total »

Hi,
find attached an example containing two files.
Because i wanted to show a way without macro, you have to click twice within the form.
  • register the database file Adresses_report_single_row.odb -> Tools/Options.../OpenOffice Base/Databases/New ...
  • Open Adresses_report_single_row.odb
  • Rightclick on Form Addresses -> Edit
  • Rightclick on Pushbutton open Writer -> Control ... -> Tab General
  • select Action: Open document/web page
  • click on the three dots most right from URL -> select the writer file Report_current_row.odt
  • Close properties window
  • Save the form, close the form
  • Ready, open the form by doubleclick, select a name in the Listbox top left, click the button save Name , click open Writer Print ...
R
PS: to understand, you can read [Example #1] Filter/Search with Forms (leveraging SubForms)
Attachments
Adresses_report_single_row.odb
(80.92 KiB) Downloaded 224 times
Report_current_row.odt
(9.77 KiB) Downloaded 209 times
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
Shuttleu
Posts: 3
Joined: Thu Apr 02, 2015 12:11 am

Re: Open Writer doc with database fields for a letter

Post by Shuttleu »

F3K Total wrote:Hi,
find attached an example containing two files.
Because i wanted to show a way without macro, you have to click twice within the form.
  • register the database file Adresses_report_single_row.odb -> Tools/Options.../OpenOffice Base/Databases/New ...
  • Open Adresses_report_single_row.odb
  • Rightclick on Form Addresses -> Edit
  • Rightclick on Pushbutton open Writer -> Control ... -> Tab General
  • select Action: Open document/web page
  • click on the three dots most right from URL -> select the writer file Report_current_row.odt
  • Close properties window
  • Save the form, close the form
  • Ready, open the form by doubleclick, select a name in the Listbox top left, click the button save Name , click open Writer Print ...
R
PS: to understand, you can read [Example #1] Filter/Search with Forms (leveraging SubForms)
Thank you for your reply, That is exactly what I was after.
OpenOffice 4.1.1 on Mac OS X
dreamquartz
Posts: 881
Joined: Mon May 30, 2011 4:02 am

Re: Open Writer doc with database fields for a letter

Post by dreamquartz »

I like F3K Total's solution too.
I use my method approx. the same way you needed.
I print a file, select the one I need from the list, and end up the same way. I can, however, select more than one name at the time to print multiple letters as well.
F3K Total's is very user friendly.

Good luck,

Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.
Post Reply