Printing to Continuous Roll

Discuss the database features
Post Reply
Inspector 5
Posts: 7
Joined: Sat Aug 26, 2017 6:26 pm

Printing to Continuous Roll

Post by Inspector 5 »

I have a simple database for tracking assets: "Item Number", "Description", etc., etc.

It has a single table for the data and a filter-table for searching/filtering for desired items. All is working well, so far.

What I need to do, now, is print labels for each item as needed.
The plan is to use my "Item Search" form to find a desired item then, by clicking a button (or something) print an adhesive label for that item.
This is NOT a mail merge situation. This does NOT involve using Avery labels or the like.

I need to be able to print directly to a "continuous roll" type label printer.
Specifically, THIS printer: https://www.graphicproducts.com/labelin ... ro-series/

I will be printing on roll-labels that are 1-inch wide and 18-inches long.
(Although the printer will print labels that are virtually any arbitrary length, the specification that I have been given is 18-inches.

I HAVE designed a form that can be used to print a label and that DOES work with the printer. It prints nicely! :)

The problem I have is that I am dealing with naive end-users. They don't understand how databases work and they don't comprehend concepts like searching and filtering via OO-Base's built-in controls. It must be a one-click operation. I already have a document/form which uses the main-form and a subform-grid to search via a filter-table. The user simply types in the information he wants to find ("Item #", "Description", etc.) then clicks the "Search" button on the form to find a set of candidate items to print.

Now, I need to go from "Point-A" to "Point-B"... Searching/selecting an item then, by the click of a button (or similar action), cause a label to be printed.

Again, I already have a form that will print a label but you must use OO-Base's built-in search/filter controls and my end users aren't capable of doing that.

What method(s) can I use to attack this problem?

Thanks! :)

Randy S.
OpenOffice 4.1.3 - Mac OS X 10.10.5
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Printing to Continuous Roll

Post by John_Ha »

Welcome to the forum.

Record? write? a macro to do what you want. The users run the macro with their search argument which creates the form and prints it. Andrew Pitonyak's Useful Macro Information For OpenOffice is an invaluable resource for macro writers as is the Macros and UNO API forum. See the Base documentation (the LO manual is probably more comprehensive than the AOO manuals) for more information.

To some extent you can forget "labels" - you are printing a 4" x 18" (or 18" x 4") page onto a sheet which is 4" wide and 18" long. However, you will have to synchronise the label position in the printer so the page prints correctly.

As a (rather poor) workaround, run a background task which creates all the labels as PDF files, and continually updates the saved PDFs each time something in the database changes. Users search for the PDF and print it.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Inspector 5
Posts: 7
Joined: Sat Aug 26, 2017 6:26 pm

Re: Printing to Continuous Roll

Post by Inspector 5 »

Thanks! :)

I will check those links for info to see what I can dig up. :)

I agree... These aren't labels in the usual sense of the word.
They are more like a page that is 18 in. long, just as you say. They are only labels in the generic sense to mean "an adhesive backed sheet that one sticks to an item for identification purposes."

I have designed a form that operates the printer and prints the desired information in the format needed.
It is merely a writer document which is X in. wide and Y in. tall with proper margins for the page set on all four sides and has correctly linked fields (text boxes) where the information needs to go. It works well and my supervisor likes the way these new labels look.

I'm not super great at writing macros. If the docs you mention are descriptive enough, I'm sure I can create a macro in "cookbook fashion" from what's in the docs.

Can you describe, in general terms, what the macros would need to do?
(e.g. "Use 'function(x)' to invoke some action then pass that information to some process?")

I wish that I could describe my project in more detail but my employment is governed by I.T.A.R (International Traffic in Arms Regulations) and I can't divulge very much information in a public forum. I would need to "sanitize" my files/documents before I could post them publicly. If it is necessary, I can do that but it will take some time. (No company data is allowed to travel outside the facility without specific approval.)

Thanks for your help, so far! :)

Randy S.
OpenOffice 4.1.3 - Mac OS X 10.10.5
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Printing to Continuous Roll

Post by John_Ha »

see [Tutorial] How to record a macro (and Regular Expressions) which says:
We now record a macro to do it.
1 Tools > Macros > Record macro. This brings up a little Stop Recording pop-up window

2 do the search you require.

3 Press Stop Recording, and save the macro in My Macros > Standard > Module 1 ..., (no spaces in its name)

4 Run the macro by Tools > Macros > Run macro..., and navigate to the macro. You can optionally put the macro name on a Toolbar by r-click the toolbar > Configure ..., and add the macro. You can choose an icon for it if you want, or draw one (16 x 16 pixels BMP file) and use it.
All done.

See also the up to date Writer guide and/or Chapter 16 Customizing Writer in the OOo v3.3 Writer Manual for more information on macros. Also see Chapter 13 - Getting Started With Macros in the Getting Started Guide - V3.3

If you want to edit or write, as opposed to record, a macro, see the Macros and UNO API forum for assistance.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Printing to Continuous Roll

Post by Villeroy »

1. Register the database so it appears in the data source window.
2. Create a serial letter with the page size of your label (menu:Insert>Fields>Database... or drag column headers from the data source window into the document)
3. Attach a filter form to that serial letter. Make the form controls non-printing.

All the user needs to do is:
1. Open the text document
2. Pick the right item from a list box or enter a set of filter criteria.
3. Click OK to finish criteria input
4. Print the document, confirm serial letter and hit OK which should print to the default printer.

A very simple macro to run a mail merge by one click. The parameters are read from menu:File>Properties... tab "Custom Properties"
download/file.php?id=28169
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
Inspector 5
Posts: 7
Joined: Sat Aug 26, 2017 6:26 pm

Re: Printing to Continuous Roll

Post by Inspector 5 »

I've been making progress, thanks to all your help. :)

What I've done, so far, is to make a form document which has pages, each 1 in. tall and 18 in. wide.
The top two pages have text box elements which contain the information to be printed. The pages below contain text boxes, buttons and a grid so that the user can search or "call up" the information that needs to be printed. The elements used to search are set as non-printable. Only the items on the top two pages is left printable.

The user opens the form document, types in the search info and, if there is more than one item in the found set, selects its line in the sub-form grid. The information at the top of the document changes to what has been selected in the grid. The user types CTRL-P to print.

Good points:
1) This process is fairly easy to use once the user has been shown what to do.
2) I was able to do this without using macros or scripts. (Scripts/macros are frowned upon at my place of work because of ITAR security concerns. For instance: Stuxnet)

Bad points:
1) The screen is clunky looking. The user sees four horizontal bands across the screen which makes the form non-intuitive.
2) When the user prints he must be sure to select ONLY pages 1 and/or 2 to be printed else the printer will spit out blank strips. (Which is a waste of material.)

My task, now, is to clean this up and make it more intuitive to use and make it look nicer.

Got any ideas?

T.I.A! :)
Randy S.
OpenOffice 4.1.3 - Mac OS X 10.10.5
Inspector 5
Posts: 7
Joined: Sat Aug 26, 2017 6:26 pm

Re: Printing to Continuous Roll

Post by Inspector 5 »

A little information about the nature of this project...

This project is for an electronics manufacturing facility. We operate a Surface Mount Technology (SMT) assembly line.

As you may already know, one of the first steps in the SMT process is to stencil the bare PC boards with solder paste in the locations where the components are to be mounted. It bears a resemblance to the same method that is used to silkscreen designs onto T-shirts. The only difference is that it is done on automated machines using stainless steel stencils. These stencils are mounted in metal frames (line a picture frame) which are approx 24" square.

We have nearly 1,000 of these stencils stored in large racks like the stacks of a library. Something like this...
Image
(This is not a picture of our facility. Our facility has ten times this many stencils.)

My job is to track/inventory all of the stencils in the library and to make it easy for factory workers to find the stencils they need to do their jobs.
( i.e. Factory workers are under pressure to produce a certain number of pieces of product per hour and don't have time to fuss around trying to find the things they need to do their jobs.)

So far, I have a database up and running and it is working pretty well... Thanks to all your help! :)

All I need to do is to put a little bit of polish on it so that it looks good and is easy for factory workers to use.
OpenOffice 4.1.3 - Mac OS X 10.10.5
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Printing to Continuous Roll

Post by John_Ha »

Inspector 5 wrote: Bad points:
1) The screen is clunky looking. The user sees four horizontal bands across the screen which makes the form non-intuitive.
2) When the user prints he must be sure to select ONLY pages 1 and/or 2 to be printed else the printer will spit out blank strips. (Which is a waste of material.)
Can you upload a small file (128 kB max here) so someone can make suggestions.

Create two reports, one the single page, and one the double page. The user prints which he needs.

Or add two buttons - Print page 1 and Print pages 1 and 2 - but it would need a macro of sorts. I don't think you should be worried about macros you write - it is those you get sent you have to worry about. See Macros and UNO API
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Inspector 5
Posts: 7
Joined: Sat Aug 26, 2017 6:26 pm

Re: Printing to Continuous Roll

Post by Inspector 5 »

Yes but give me some time to make a sanitized version.
I can't post real data in the clear like this or else a couple of men in dark suits might show up on my doorstep. ;) ;) ;)
OpenOffice 4.1.3 - Mac OS X 10.10.5
Inspector 5
Posts: 7
Joined: Sat Aug 26, 2017 6:26 pm

Re: Printing to Continuous Roll

Post by Inspector 5 »

Here is a link to a copy of the database in its current form:
https://spaces.hightail.com/receive/ZoZk1ScHnj

TABLES:
1) "Stencil-Table" - Main table for data storage.
2) "Filter-Table" - Used for filtering / searching records.

ID {INTEGER} - Record ID# (Primary Key)
Location {TEXT} - Stencil Storage Location in Library
Stencil ID # {TEXT} - Stencil ID# (Engraved on Stencil.)
Customer {TEXT} - Customer Name.
Assembly # {TEXT} - Product / Assembly ID.
PCB # [TEXT] - Printed Circuit Board ID number.
Rev. {TEXT} - Stencil Revision Number / Letter.
Side {TEXT} - Side of PCB. [Top, Bottom, 1-Side]
Paste Type {TEXT} - Type of Paste to be Used. [Lead, Lead Free, Water Soluble]
Initial {TEXT} - Employee Initial. (Who entered / altered information.)
ID # {TEXT} - Employee ID# (Who entered / altered information.)
Date {DATE} - Date information entered / altered.
DNU {BOLEAN} - "DO NOT USE" (Deprecation) For use when stencil version updated but may be needed for future use.
Obsolete {BOOLEAN} - "OBSOLETE" For use when stencil no longer needed. (Placed into "Dead Storage.")
Date Obsoleted {DATE} - Date when stencil deprecated / obsolete.
Reason {TEXT} - Reason for deprecation / obsolescence.
Comment {TEXT} - Misc. information for workers to take notice of.

QUERIES:
1) "Stencil Query" - Used for searching / filtering in order to locate an item.
2) "Label Query" - Used for searching / filtering in order to locate a record for label printing.

FORMS:
1) "1 - Stencil Search" - Main form used to locate items to be used.
2) "2 - Label Print" - Used to print labels via continuous form printer.

Regarding macros or scripts:
Yes, I understand that "local" scripts and macros that one writes himself are mostly harmless... assuming the script writer does his job correctly.
Anybody who produces a works, such as this one, should darn-well do his job correctly! ;)
Yes, I WILL do my level best to ensure that ANY work I produce is fit for the purpose, works as advertised and does no harm.

If I need to use macros I will but, at this point, it is better to do it without.

Thus, we avoid having to explain things to mindless, clipboard-wielding, bureaucrats who barely understand their job, much less what a macro is or how it works. ;) ;) ;)
OpenOffice 4.1.3 - Mac OS X 10.10.5
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Printing to Continuous Roll

Post by John_Ha »

Inspector 5 wrote:2) "2 - Label Print" - Used to print labels via continuous form printer.
... where you want an automatic way of printing only pages 1 and 2.

I recorded a macro while I printed only pages 1 and 2 of the 4 pages. The macro recorded successfully but when I ran it, it did nothing. The macro code does not include the fact that I wanted to print only pages 1 and 2 so I am not sure how to set it up so it prints only p1 and p2.

Can you create a third form which copies just pages 1 and 2 and print from it?

Code: Select all

sub Print_1_and_p2
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:Print", "", 0, Array())


end sub
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Printing to Continuous Roll

Post by Villeroy »

I just tested label printing on a https://www.amazon.com/Dymo-S0838770-La ... B002ZHDV3O
I created a serial letter based on an arbitrary database with one tiny page and played with the page orientation and borders. I was able to print selection of records precisely to the labels on the roll.
What is the purpose of your form? Do you want to filter out all but one particular record and then print this single record 2 times (2 "pages") on labels? Or are the 2 rows of form controls 2 labels from one record? It should be possible to do with 1 Writer page having 2 labels (table cells or frames) with no [next record] separator between the 2 labels.
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
Inspector 5
Posts: 7
Joined: Sat Aug 26, 2017 6:26 pm

Re: Printing to Continuous Roll

Post by Inspector 5 »

The reason for printing two pages (strips) is that each stencil needs to have two labels.

Strip #1 (the first page of the form) contains the information: "Customer", "Assembly #", "Side" and "Location".
It goes on the front edge of the stencil frame in the same fashion as the label on the spine of a book in a library.
This allows a "Production Assistant" to locate it in the racks and take it to the "Operator" on the assembly line where the stencil will be used.

Strip #2 (the second page of the form) contains the information: "PCB #", "Revision", and "Comment".
It goes on the top edge of the stencil so that the Operator can read it as he stands in front of the machine.
This allows the Operator to ensure that the correct stencil is being used for the required PCB. (printed circuit board)
The "Comment" information may also be used by the Operator, such as X/Y alignment of the stencil in the machine.

So, yes... This "Label" form will be used to search for ONE particular record and filter out all but one.

The worker in charge of stencil management will search for one record and print out TWO strips for each stencil.
He then verifies that the printed labels match the stencil and affixes those labels to the stencil frame in the prescribed way.

From then on, all the assistant needs to do is use the first form "1 - Stencil Search".
The assistant looks at the Work Order and uses that information to locate the correct stencil for that particular job. He then retrieves the correct stencil(s) from the library and delivers them to the assembly line.

I have a beta version of this database already operational. It works well for its intended purpose.

Previous to this, things were pretty disorganized. Deprecated (Do Not Use) stencils and obsolete stencils were stored in the same racks as the "live" ones.
The addition of the boolean fields for "DNU" and "Obsolete" allowed us to separate out those old stencils and send them to dead storage. (Old stencils are almost never thrown away. They must be kept for archival / traceabilty reasons.)

Standardization of the labels for stencils has greatly improved physical management and the search form has made retrieving stencils for use fast and easy.

So far, I have a good operating framework for this system. Now, we are at the point of refining and making it all look good.

"Spit and Polish" as the saying goes. ;)

Your help, so far, has been appreciated! :)
OpenOffice 4.1.3 - Mac OS X 10.10.5
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Printing to Continuous Roll

Post by Villeroy »

Make the filtering easier.
Add a column to the stencils table for a commonly known, unique, short name of each thing. Use column type VARCHAR_IGNORECASE. Add a unique index and make it mandatory (not null) after filling the column with unique names.
Then bind your simple print form to a parameter query SELECT * FROM "Stencils" WHERE "Short Name" = :Short_Name
Every time when you access this query by loading the form, the user will be prompted to enter a Short_Name and gets a unique record in return.
 Edit: P.S. Replace the filtering form with a reload button 
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
Post Reply