Well, depending on their complexity you could possibly use the data report inside of VB. However, there is any level of complexity to them at all you will save yourself a headache if you just use Crystal Reports.
IMHO VBs Data Report will be good enough... but if u'd be using the all impact printer might as well not to use data report nor crystal, else print directly to the printer...
.
.
eg..
fSendToPrinter "LPT1", "SOME TExT"
Public Function fSendToPrinter(vPrinter As String, vString As String) As Boolean
Static mFreeFile
On Error Resume Next
vPrinter = UCase(vPrinter)
mFreeFile = FreeFile()
If vPrinter Like "LPT*" Or vPrinter Like "COM*" Then
Open vPrinter For Output As #mFreeFile
Else
Open vPrinter For Append As #mFreeFile
End If
Print #mFreeFile, vString
Close #mFreeFile
fSendToPrinter = True
On Error GoTo 0
End Function
Public Function fSendFileToPrinter(vFilename As String, vPrinter As String) As Boolean
Static fSys As New Scripting.FileSystemObject
Static F As TextStream
Static mString As String
On Error Resume Next
If Dir(vFilename) <> "" Then
Set F = fSys.OpenTextFile(vFilename, ForReading)
mString = F.ReadAll
Set F = Nothing
Set fSys = Nothing
fSendFileToPrinter = fSendToPrinter(vPrinter, mString)
Else
fSendFileToPrinter = False
End If
End Function
Public Function fReadFile(vFilename As String) As String
On Error Resume Next
Dim fSys As New Scripting.FileSystemObject
Dim F As TextStream
Set F = fSys.OpenTextFile(vFilename, ForReading)
fReadFile = F.ReadAll
Set F = Nothing
Set fSys = Nothing
On Error GoTo 0
End Function
Public Function fSendToPrinter(vPrinter As String, vString As String) As Boolean
Static mFreeFile
On Error Resume Next
vPrinter = UCase(vPrinter)
mFreeFile = FreeFile()
If vPrinter Like "LPT*" Or vPrinter Like "COM*" Then
Open vPrinter For Output As #mFreeFile
Else
Open vPrinter For Append As #mFreeFile
End If
Print #mFreeFile, vString
Close #mFreeFile
fSendToPrinter = True
On Error GoTo 0
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.