Wrox Programmer Forums
|
Pro Visual Basic 2005 For advanced Visual Basic coders working in version 2005. Beginning-level questions will be redirected to other forums, including Beginning VB 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Visual Basic 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 18th, 2006, 02:46 PM
Authorized User
 
Join Date: Jul 2006
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Printing

How would I go about printing database records (just the ID part)
to labels (to be attached to inventory)
?



 
Old July 19th, 2006, 05:06 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

What is the database system (Oracle? SQL Server? Access?)?
What is the programming environment (VB? VBA?)?
 
Old July 20th, 2006, 09:28 AM
Authorized User
 
Join Date: Jul 2006
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SQL Server 2005 express
Visual basic .net (visual studio 2005)

 
Old July 20th, 2006, 09:29 AM
Authorized User
 
Join Date: Jul 2006
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I do have access as well though...but i would rather build on SQL Server 2005

 
Old July 20th, 2006, 12:31 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Well, I don't know if SQL Svr has reporting functionality... (You'll have to look into that in the documentation that you have available to you.)

Within VB though, you can do a variety of things.
Vb has Crystal Reports, a very powerful reporting system. Like all software that is powerful, it has so many capabilities that creating reports can sometimes feel like creating an application! But look into it.

Second, you can write out the data to a simple text file. Very primitive, but often enough.

Third, you can automate Word, and use Word to “build” a report line-by-line, specifying font faces, character weight and slant, tabs, and so on, ultimately calling upon Word’s printing abilities to print the result. (Plus, since it is a document, after all, you can save it, email it, etc.)

In the last two cases, you would open a recordset of your data, and loop through it, taking the appropriate action on a row-by-row basis.

If you open a dataset, you can open several tables within it, and set their relationship. Having done that (if you have a one-to-many relationship invloved), you can move from record to record in the table on the “one” side of the relationship, obtain the identifying field, and use that to get the related records on the “many” side. I think there is also some functionality to have the DataSet itself give only the related records from within a relationship it has knowledge of, based on the current record of the table on the “one” side.

Two really beneficial aspects of using Word in an automated fashion:

   1. You can type a sample document in Word yourself while recording a macro, to get most of the syntax that Word needs to accomplish the look you are after.

   2. Word has lable-making functionality built in, and you can utilize that to your advantage. (I sure hate it when people say “leverage” when they mean “utilize”...)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help about printing Fahim Crystal Reports 0 November 12th, 2006 11:14 PM
Printing Arunachalam Beginning VB 6 2 October 12th, 2006 07:44 AM
Printing uchkid Pro Visual Basic 2005 1 September 7th, 2006 03:37 AM
capturing printing settings when printing reports nikolaosk Access VBA 0 February 8th, 2005 04:14 AM
Printing NiNe ADO.NET 5 April 7th, 2004 04:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.