473,398 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Here is a sample printing

As I stated before, the Printer.print in VB 6.0

How do you print the following in VB.Net 2005

Public Function PrintVendorList()
'mdiMain.
'Print the List of Vendors.

Set rsCompany = New ADODB.Recordset
Set objCompany = New Acct08DLL.CCompany

Set rsPrint = New ADODB.Recordset
Set objPrint = New Acct08DLL.CCompany

Set rsPrint = objPrint.PrintVendors(mdiMain.stbar.Panels(9).Text )
Set rsCompany = objCompany.SelectCompany(mdiMain.stbar.Panels(9).T ext)

If rsPrint.eof And rsPrint.BOF Then

Set rsPrint = Nothing
Set objPrint = Nothing

Set rsCompany = Nothing
Set objCompany = Nothing

Exit Function
End If

mdiMain.CMDialog1.CancelError = True

On Error GoTo PrintErr

mdiMain.CMDialog1.ShowPrinter

Printer.Orientation = vbPRORPortrait
Printer.PaperSize = vbPRPSLetter

Printer.Print
Printer.Print
Printer.FontBold = True
Printer.FontSize = 18

Dim x, y, A$, B$
Dim Counter

x = Printer.ScaleWidth / 2
A$ = "List of Vendors for " & rsCompany!CompName
B$ = "from " & App.EXEName

Printer.Font = "Courier New"
Printer.FontSize = 14
Printer.FontBold = True
Printer.CurrentX = x - Printer.TextWidth(A$) / 2
Printer.Print A$
Printer.CurrentX = x - Printer.TextWidth(B$) / 2
Printer.Print B$
Printer.Print
Printer.Print
' Printer.FontBold = False
' Printer.FontSize = 8

Counter = 1

Printer.Print Tab(1); "Row #"; Tab(9); "Vendor Name"
Printer.Print

Printer.FontBold = False
Printer.FontSize = 8

Do Until rsPrint.eof
Printer.Print Tab(5); Format(Counter, "000"); Tab(15); rsPrint!VName

'Printer.Print
Counter = Counter + 1

rsPrint.MoveNext

Loop

Printer.Print
Printer.FontSize = 8
Printer.FontBold = True
Printer.Print "Printed on " & Format(Now, "mmm dd, yyyy" & " @ " &
"hh:nn:ss ampm") & " from " & App.EXEName
Printer.FontBold = False

Printer.EndDoc

Set rsPrint = Nothing
Set objPrint = Nothing

Set rsCompany = Nothing
Set objCompany = Nothing

PrintErr:
If Err = cdlCancel Then
Exit Function
ElseIf Error = 0 Then
Exit Function
Else
Exit Function
End If

Exit Function

End Function

--
Thanks in advance
bob
ro******@mountaincable.net
Dec 15 '07 #1
0 946

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Jim Hill | last post by:
I've done some Googling around on this and it seems like creating a here document is a bit tricky with Python. Trivial via triple-quoted strings if there's no need for variable interpolation but...
4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
5
by: EMonaco | last post by:
All, Got this sample from a discussion on ICertificatePolicy. public enum CertificateProblem : long { CertEXPIRED = 0x800B0101, CertVALIDITYPERIODNESTING =...
4
by: Suzanka | last post by:
Hello, I have an application written in C# on visual studio .NET. It is a web aplication. The application consists of many different forms, that users occassionaly want to print out for filing....
3
by: Peter Kaufman | last post by:
Hi, Subject line says it all except VB.NET preferred, but C# would be okay too. Thanks a lot, Peter
6
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
1
by: =?Utf-8?B?Um9nZWxpbw==?= | last post by:
hey, I want to print items in different places on the same piece of paper. maybe one item at the upper left, one item in the bottom right. or maybe a grid of 6 items, all spaced evenly in 2...
1
by: Sebouh | last post by:
Hi guys. I need your help to solve this problem. You see, i need to get the samples from an audio stream, to do FFT analysis. I need to read those amplitudes and pass them to an analyzer so i can...
69
by: raylopez99 | last post by:
They usually don't teach you in most textbooks I've seen that delegates can be used to call class methods from classes that are 'unaware' of the delegate, so long as the class has the same...
2
by: necron99 | last post by:
import RuntimeEnvironment as renv import os, sys import win32com.client import getpass OMI = win32com.client.Dispatch("MOVEitAPI.clientObj") OMI.Host = system
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.