Advertisement

07.23.2008 at 01:00PM PDT, ID: 23589955
[x]
Attachment Details

I'm trying to make changes to a vb 6.0 application that used Crystal 4.6 (old stuff) to Crystal XI.  I am trying to pass a sql query to the crystal report that is already designed.  Can someone help?

Asked by coenewnes in Crystal Reports Software

Tags: Business Objects, Crystal Reports, XI

Visual Basic 6.0
XP Professional
Crystal Reports XI
I am trying to update the version of crystal inside my VB 6.0 application.
Old version of crystal = 4.6 (was originally shipped with Visual studio)
New version of crystal = XI
Instead of ocx it uses rdc ; I want to be able to pass a sql query to a database
table and have it print or view the report.
Can you help?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
=======MODULE THAT SELECTS PRINT FUNCTION===============================
Private Sub cmdPrint_Click()
    
    Dim varResponse As Variant
    
        frmPrint.repPack.SQLQuery = "SELECT QUERY"
        frmPrint.Show 1
 
End Sub
========frmPrint ===================================================
 
Private Sub Form_Load()
    Left = (Screen.Width - Width) / 2
    Top = (Screen.Height - Height) / 2
    
    On Error GoTo PrintLoadError
    '
    ' set number of copies to 1 default
    '
    frmPrint.cbxCopie = 1
    '
    ' if no default printer disable,
    '    else set as default choice
    '
    If Printer.DeviceName = "" Then
        optPrinter.Enabled = False
    Else
        optPrinter.Caption = Printer.DeviceName & "  on " & Printer.Port
        optPrinter.Value = True
    End If
    
    Exit Sub
PrintLoadError:
    optPrinter.Enabled = False
    Exit Sub
End Sub
 
Private Sub cmdPrint_Click()
    Dim varResponse As Variant
    Dim PrintDest As Integer
    
    On Error GoTo PrintError
    
    PrintDest = IIf(optWindow = True, 0, 1)
    repPack.Destination = PrintDest
    '
    ' Print Preview
    '
    If PrintDest = 0 Then
        frmPrint.Enabled = False
        frmPrint.cbxCopie.Enabled = False
    End If
    '
    ' Printer
    '
    If PrintDest = 1 Then
        frmPrint.Enabled = True
        cmdPrint.Enabled = False
        repPack.CopiesToPrinter = cbxCopie
    End If
        
    repPack.ReportFileName = "filepath + filename"
     
    repPack.Action = 1
    cmdPrint.Enabled = True
    Screen.MousePointer = 0
    If PrintDest = 0 Then frmPrint.Enabled = True
    Exit Sub
    
    Unload Me
 
PrintError:
    Screen.MousePointer = 0
    frmPrint.Enabled = True
    MsgBox (Err.Number & " - " & Err.Description)
 
    Unload Me
End Sub
[+][-]07.23.2008 at 03:37PM PDT, ID: 22074577

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Crystal Reports Software
Tags: Business Objects, Crystal Reports, XI
Sign Up Now!
Solution Provided By: mlmcc
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.24.2008 at 08:13AM PDT, ID: 22080052

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 06:27PM PDT, ID: 22085261

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.28.2008 at 01:24PM PDT, ID: 22106521

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.28.2008 at 01:52PM PDT, ID: 22106716

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.22.2008 at 09:10PM PDT, ID: 22295728

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]08.28.2008 at 07:34PM PDT, ID: 22341761

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628