Solved

Printing labels from vb.net

Posted on 2007-04-10
5
2,646 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 167 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 167 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 166 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now