LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Print Fields that are Centered on the Label

Labview 6.1 - Which VI do I call or Attribute do I set to make a String Field "Centered" on its Row on a Zebra Label? I need to specify the String Data, the Font Size and Centered about Position. One Centered field per Row (3 Rows). I am using the NewReport.vi, SetReportOrientation.vi, SetReportFont.vi AppendReportText,vi, PrintReport.vi and DisposeReport.vi
0 Kudos
Message 1 of 4
(3,845 Views)
My understanding of zebra is that it is simply a text-based formatting language. If so, then I think you would simply append ascii data to a text report and you don't need to worry about the font / orientation of the ascii data you are sending, rather you need to know the ZPL codes to do the formating for you. I don't know ZPL (it's only used in zebra technology equipment), but I would assume it's something like "*cn my label" would center "my label." This is specific to the ZPL language, you might be able to find something on google about it.

If I mis-understood your situation, let me know.
0 Kudos
Message 2 of 4
(3,845 Views)
Are you telling me that Labview does not support the Printer Driver that is installed for the Label Printer? And that I have to learn unigue programming codes for each and every printer that I will ever use? If True then that is extremely antiquated. Isn't the whole idea of having Windows Printer Drivers suppose to prevent such LOW LEVEL Hard Coding of Printer Codes in your Sofware? M/S Word supports various Fonts, Orientation, Left, Right & Center Justification of Fields on the Label. Why can't Labview? Also, I cannot find any (X,Y) Positioning VI to place the Field at the proper position on the Label. In a Graphical Environment like Windows I should be able call a VI to tell Labview the X & Y Position, Font, Point Size, Justification and Text and then LAB
VIEW should pass that info the the printer Driver regardless of which Printer is installed. Your solution of Hard Coding Printer Codes was acceptable in the 80'S but should not be required by a language like Labview in the year 2003.
0 Kudos
Message 3 of 4
(3,844 Views)
LabVIEW does support the windows printer driver, I was thrown off by the fact that you said "zebra label." We have a report generation toolkit that will allow you to create more advanced reports and can programatically control microsoft word and excel to create as complex of a document as you desire.

Our basic report generation toolkit that ships with LabVIEW supports simple reports and layouts. It also allows for HTML reports. You can then append any HTML formatting to the report that you desire (such as the center tag).

You could also continue to use the standard report by appending spaces to the string you are printing. For example, if you know that your printer is 80 characters wide (using a fixed width font), you can take the size of the string "len" and append (80-len)/2 number of spaces to the string. If you need help doing this, let me know.

We actually implimented a barcode label printing VI that printed an entire front panel. We created a VI that had an array of controls and we formatted the controls to our desire (one was a centered string). We then used the "print panel vi" in the block diagram. That we we simply wired the inputs to the VI and it printed the front panel to the printer onto the labels (we use this on our large shipments that have more than one item).

The ActiveX examples that ship with LabVIEW and on our website are very good starting points for creating word reports, but if you are going to use LabVIEW to manipulate Microsoft Word and Excel, I really suggest getting our Report Generation Toolkit for Microsoft Office. The RGT (Report Generation Toolkit) contains a complete set of easy to use VIs to programmatically create and edit Word and Excel documents. The Microsoft Office ActiveX interface is huge, and it is often times hard to find good complete documentation on how to perform certain tasks. The RGT VIs hide all of the ActiveX complexity and really simplify the tasks, but as a developer I really appreciate the fact that the VIs contain all of the ActiveX code on the block diagram so that I can look at them as examples and modify them to my desire. You can find out more about the RGT from ni.com, click on Products, LabVIEW, LabVIEW Addons, LabVIEW Toolsets, LabVIEW Report Generation Toolkit.

I hope some this gives you an idea you can run with.
Message 4 of 4
(3,844 Views)