borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Crystal Report 10, VB6 & with password Msaccess)Next Topic (2 Commands under 1 Connection) New Topic New Poll Post Reply
AndreaVB Forum : Reporting tools : Parameterized command in Crystal Report 9
Poster Message
goldenmusketeer
Level: Whizz Kid


Registered: 23-12-2004
Posts: 16

icon Parameterized command in Crystal Report 9

Helloooo...

I am using Crystal Report 9 and VB6 to design a report..
I am using OLEDB connection to connect to report...
Then I created a command by cliking on "COMMAND" tab
This command is a parameterized one which is given below...
"SELECT * FROM COmpany WHERE compid='{?compid}'

Now I am calling the report from program like this --
Option Explicit
Dim Tables As CRAXDRT.DatabaseTables
Dim Csprop As CRAXDRT.ConnectionProperties
Dim Cs As CRAXDRT.ConnectionProperty
Dim cpars As CRAXDRT.ParameterFieldDefinitions
Dim cpar As CRAXDRT.ParameterFieldDefinition


Private Sub Form_Load()
    Call ReportSetConn
End Sub


Public Sub ReportSetConn()
    Dim rptobj As CRAXDDRT.Report
    Set rptobj = New CrystalReport1
    Screen.MousePointer = vbHourglass
    CRViewer.DisplayGroupTree = False
    Set Tables = rptobj.Database.Tables
    Set Csprop = Tables.Item(1).ConnectionProperties
    Csprop.Item("Provider") = "SQLOLEDB"
    Csprop.Item("Data Source") = "SERVER"
    Csprop.Item("Initial Catalog") = "TESTDATABASE"
    
   Dim prval As CRAXDDRT.ParameterValues
   prval.
    With rptobj
        .ParameterFields(1).AddCurrentValue ("0001")
    End With
    Screen.MousePointer = vbHourglass
    CRViewer.ReportSource = rptobj
    CRViewer.ViewReport
    Screen.MousePointer = vbDefault
End Sub


No errors are given but not data are displayed, even if table contains data..But after report is displayed and if I then enter parameter value through the prompt then the values aare displayed....
Bottomline is parameter is not getting any value when the value is send through VB6 code....
WHAT TO DO  

____________________________
.....Joy

05-04-2007 at 02:22 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Reporting tools : Parameterized command in Crystal Report 9
Previous Topic (Crystal Report 10, VB6 & with password Msaccess)Next Topic (2 Commands under 1 Connection) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder