?
Solved

Printing labels from vb.net

Posted on 2007-04-10
5
Medium Priority
?
2,664 Views
Last Modified: 2008-02-01
I would like to print labels from a .net form. I have looked at the possibility of printing directly from vb.net or sending data to Word and printing from there. I see there may be a few ways of putting the data into Word and have experimented with using a Word.XML template type file with some success. I'm looking at replacing text in ordinary Word file now. I haven't worked out how to do this without opening and closing the file for every print yet.

Each label I print will vary slightly in one field (this data is from scales via serial connection). I'd like any advice re neat and foolproof systems for printing this data. The solution is no good if code fails because two word applications are open or anything vague like that. I will print a summary with a total weight from my dataset after printing a batch of labels. It seems neat to save an xml file at this point and fill in a Word.XML template from the saved data. The individual labels have still got me scratching my head and slowly exploring vb.net.

Points: I can do 500 and spread em around if people will be so kind as give some ideas that might save me a bit of time. I don't expect there are right and wrong answers to this, rather there may be insightful assistance If I'm lucky.
0
Comment
Question by:PiedBird
5 Comments
 
LVL 3

Accepted Solution

by:
dmagliola earned 334 total points
ID: 18887604
In my experience, the best tool to do this is Crystal Reports.

Word will do the job, but it'll give you lots of headaches (many of the type you mentioned, with open instances of Word doing strange things), and it can get pretty slow too.

Also, printing straight from .Net will work, but styling the output will take you too much time for it to be practical, and if you ever need to change it it will probably be painful.

I have in fact created an application similar to the one you intend, from what I understand. It's also an application that takes input from a scale, and prints out a label to stick on the thing being weighed. Crystal reports behaves wonderfully.
0
 
LVL 18

Assisted Solution

by:vbturbo
vbturbo earned 334 total points
ID: 18887919
Hi

These would might be of some assistance and give a couple of inputs.

http://www.codeproject.com/vb/net/dynamic_report_with_query.asp

http://www.codeproject.com/vb/net/CrystalContrl.asp

vbturbo
0
 

Author Comment

by:PiedBird
ID: 18887938
Thanks both.
I'll have a little look and get back to you.
0
 
LVL 28

Assisted Solution

by:iboutchkine
iboutchkine earned 332 total points
ID: 18889127
I prefer to use MS Access. ENter you records to the database and create report that will print labels. Then call this report from .NET application
0
 

Author Comment

by:PiedBird
ID: 18893248
Thanks. I don't have Crystal Reports so for the minute I'll work with vbturbo's first link and the Access idea. I've worked with Access reports before but only from Access. I might post another question about how a joint effort of .Net and Access might be structured; a few ideas before I start could be a whole lot quicker than my usual clueless approach.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question