|
-
May 23rd, 2006, 05:39 AM
#1
Thread Starter
Member
Printing Data Report in VB 6
Hi
I developed a database application in VB 6 and included data reports, fed with ado data objects. I tested and it worked fine on my machine (which I used for development).
When I packaged and installed on my client's machine, the data report did not print, giving at times errors. I tried many things, and after a week of hard work, I found out that I needed to install VB 6 and all its components on the client's machine for the data report to print.
So, on all machines on which there is no VB installed, the print does not work. Once I install VB 6 and all its components. It does. Problem is that my clients do not want to be bothered about having to install VB 6 (which they will never use, since they are not developers), and they are 150% right.
Can anyone help me out in telling me how I can get the data report to print without having to install VB6 on a machine. At least if I could get to know the component which is needed in the installation, I would have packaged it along. Thanks in advance.
Best regards
-
May 23rd, 2006, 05:51 AM
#2
Re: Printing Data Report in VB 6
what type of error occuring there
-
May 23rd, 2006, 05:53 AM
#3
Re: Printing Data Report in VB 6
What are you using as a deployment tool?
-
May 23rd, 2006, 05:55 AM
#4
Re: Printing Data Report in VB 6
VB Code:
Private Sub CREPORT_Click()
On Error GoTo ErrorTrap
TSQL = ""
TSQL = "SELECT * FROM LEAVE_TABLE WHERE FIRM='" & COMFIRMNAME.Text & "' AND S_DATE BETWEEN #" & DTP1.Value & "# and #" & DTP2.Value & "#"
Set RTMP = Get_Special_Record_Set(TSQL)
If RTMP.RecordCount = 0 Then
MsgBox "Record Not Found", vbInformation
Exit Sub
End If
With FIRM_STATUS
Set .DataSource = Nothing
Set .DataSource = RTMP.DataSource
End With
'firm status is datareport name
'don't forget to write all control in section 1 of your report
'coding by banna
With FIRM_STATUS.Sections("Section1").Controls
.Item("LD1").Caption = DTP1.Value
'label first name ld1
.Item("LD2").Caption = DTP2.Value
'label second name ld2
.Item("TXTFIRM").DataMember = ""
.Item("TXTFIRM").DataField = RTMP.Fields("FIRM").Name
'textbox first name txtfirm
'firm is field firm in the table
.Item("TXTLOCATION").DataMember = ""
.Item("TXTLOCATION").DataField = RTMP.Fields("LOCATION").Name
'txtbox second name txtlocation
'location is field location in the table
.Item("LABNOEMP").Caption = EMP
'label third name labnoemp
.Item("LSALARY").Caption = Val(SALARY)
'label lsalary name lsalary
End With
FIRM_STATUS.Refresh
'firm_status is datareport name
FIRM_STATUS.Show
ErrorTrap:
If Err.Number <> 0 Then
MsgBox "Error (" & Err.Number & "): " & Err.Description, vbCritical, "Error"
End If
End Sub
-
May 23rd, 2006, 08:21 AM
#5
Re: Printing Data Report in VB 6
Moved to reporting section.
-
May 23rd, 2006, 11:57 PM
#6
Thread Starter
Member
Re: Printing Data Report in VB 6
Hi Shakti and Hack
Thanks for replying to my thread.
To answer your question, Hack, I am using Visual Studio 6's package and deployment wizard.
Shakti, the errors that I get are of tw types. Either I get an error message speaking of an object which is not created or initialise (or something like this), or I don't get anything at all. Everything seems to be working fine, but the document does not print.
I am pasting the codes for one module which does the printing:
VB Code:
Public Sub printInvoice()
Dim title As String
Err.Clear
On Error Resume Next
adoPrint.RecordSource = "select * from salesdetails where salesid = " & lastSalesID
adoPrint.Refresh
Set repWholesaleSalesInvoice.DataSource = adoPrint
title = "Date: " & vbTab & vbTab & txtDate.text & vbTab & _
Format(txtTime.text, "HH:mm") & vbCrLf & vbCrLf & _
"Rcpt/Inv. No.: " & vbTab & vbTab & receiptNumber & vbCrLf
client = cboClient.text
If Split(client, " ")(0) <> "NONAME" Then
title = title & "Client: " & vbTab & vbTab & client
End If
repWholesaleSalesInvoice.Sections(1).Controls(3).Caption = title
repWholesaleSalesInvoice.Sections(5).Controls(2).Caption = "Salesperson: " & salespersonCode
repWholesaleSalesInvoice.Hide
repWholesaleSalesInvoice.printReport
If Err.Number <> 0 Then
MsgBox "Error generating invoice: " & vbCrLf & Err.description
End If
End Sub
The headers which you set at run time, I set them at design time.
All I need to know now is how to get my application running and printing reports on a machine which does not have VB6 installed.
Thanks a lot, dudes.
Here from you soon.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|