[Solved] Sequential Print Numbering

Discuss the word processor

[Solved] Sequential Print Numbering

Postby SKawyer » Wed Oct 31, 2018 10:11 pm

I have a writer doc created for invoices. In the past I've had to enter to PO number manually; example 15444 *Print*, 15445 *Print*, etc.

I'm sure there is a macro out there to automatically print the numbers in sequence without changing each individual number. Example would be I would like to start with number 15444 and print 10 copies to have 15454 be the last number. I've found Microsoft word has a program for this however it wont obviously work for OpenOffice.
Last edited by SKawyer on Thu Nov 01, 2018 9:13 pm, edited 1 time in total.
OpenOffice 4.1.2 Windows 7
SKawyer
 
Posts: 4
Joined: Wed Oct 31, 2018 10:02 pm

Re: Sequential Print Numbering

Postby Villeroy » Wed Oct 31, 2018 11:33 pm

Download and save the attached database document.
menu:Tools>Options... OpenOffice Base > Databases [New ...]
Point to the database document.

Open your invoice template.
Put the cursor where you want to insert the invoice number.
menu:Insert>Fields>Other... tab:Database
Choose InvoiceNo > NextNum and hit [Insert]

Now every time when you are going to print a new invoice, you get a message like this:
"Your document contains address database fields. Do you want to print a form letter?"
Anser with <Yes> (hit Enter).
The invoice numbers start with 1,000. If you want to start with another number, say 10,000:
Open the database document.
menu:Tools>SQL...
Code: Select all   Expand viewCollapse view
ALTER SEQUENCE "SEQ" RESTART WITH 10000

Button [Execute]
Close the database.
Attachments
InvoiceNo.odb
Database document generating a sequential number in query "NextNum"
(3.33 KiB) Downloaded 49 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 27896
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Sequential Print Numbering

Postby SKawyer » Thu Nov 01, 2018 5:57 pm

This just prints the Inovice number as *InvoiceNo.NextNum* but no numbers. It does not ask for anything before I print besides the usual printer properties.
OpenOffice 4.1.2 Windows 7
SKawyer
 
Posts: 4
Joined: Wed Oct 31, 2018 10:02 pm

Re: Sequential Print Numbering

Postby Villeroy » Thu Nov 01, 2018 8:10 pm

You are right. The mail merge field doesn't work with a database sequence like it does with database records.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 27896
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Sequential Print Numbering

Postby SKawyer » Thu Nov 01, 2018 8:45 pm

How do I program it to print with the sequence numbers?
OpenOffice 4.1.2 Windows 7
SKawyer
 
Posts: 4
Joined: Wed Oct 31, 2018 10:02 pm

Re: Sequential Print Numbering

Postby MrProgrammer » Thu Nov 01, 2018 9:00 pm

SKawyer wrote:I have a writer doc created for invoices. … Example would be I would like to start with number 15444 and print 10 copies …
Create a new spreadsheet. Put "Invoice" in A1 and 15444 in A2. Click A2. Drag the fill handle in the lower right corner down to fill ten cells with numbers. Save the spreadsheet. Create a new database and connect it to an existing "database", your spreadsheet, as its source. Register and save the new database. Open your Writer document. Use View → Data Sources and navigate to your spreadsheet data. Near the top of the screen drag "Invoice" down into the document to create a field. Position the field where you want it in the document. File → Print → Form letter? → Yes → Records → All → OK. You might need to uncheck "Print automatically inserted blank pages", depending on your printer dialog.

Read about Mail Merge in Help → Index or in User Guides (PDF) or searching for topics about it in the forum. Create Report (Index Cards) of multiple records from excel is a somewhat similar topic with pictures.

You only need to create the spreadsheet and database once (steps in pink). You can save a bit of time if you insert the field, then save that modified document as a template (steps in green). To print different invoice numbers open the existing spreadsheet, create the numbers as desired, save it, then perform the steps in black.

SKawyer wrote:start with number 15444 and print 10 copies to have 15454 be the last number
When starting with 15444 and printing ten sequentially-numbered invoices the last will be 15453, not 15454.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
MrProgrammer
Moderator
 
Posts: 3959
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: SOLVED Sequential Print Numbering

Postby SKawyer » Thu Nov 01, 2018 9:13 pm

Thank you, that worked.
OpenOffice 4.1.2 Windows 7
SKawyer
 
Posts: 4
Joined: Wed Oct 31, 2018 10:02 pm


Return to Writer

Who is online

Users browsing this forum: No registered users and 26 guests