[Solved] Sequential Print Numbering

Discuss the word processor
Post Reply
SKawyer
Posts: 4
Joined: Wed Oct 31, 2018 10:02 pm

[Solved] Sequential Print Numbering

Post by SKawyer »

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
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Sequential Print Numbering

Post by Villeroy »

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

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 282 times
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
SKawyer
Posts: 4
Joined: Wed Oct 31, 2018 10:02 pm

Re: Sequential Print Numbering

Post by SKawyer »

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
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Sequential Print Numbering

Post by Villeroy »

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 with LibreOffice 6.0, latest OpenOffice and LibreOffice
SKawyer
Posts: 4
Joined: Wed Oct 31, 2018 10:02 pm

Re: Sequential Print Numbering

Post by SKawyer »

How do I program it to print with the sequence numbers?
OpenOffice 4.1.2 Windows 7
User avatar
MrProgrammer
Moderator
Posts: 4905
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Sequential Print Numbering

Post by MrProgrammer »

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, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
SKawyer
Posts: 4
Joined: Wed Oct 31, 2018 10:02 pm

Re: SOLVED Sequential Print Numbering

Post by SKawyer »

Thank you, that worked.
OpenOffice 4.1.2 Windows 7
Post Reply