computergeek
Programmer
Hello,
I want to open a Crystal Report in VB without requiring an ODBC DSN connection to be defined for the report. I initially created the Crystal report with an ODBC connection driver and did a Convert Database Driver to use OLE (pdsoledb.dll). (Tried Pdssql.dll did not work very well... lots of errors.) I would like somehow use my existing connection string settings within the VB application to launch the report. (I am using the RDC method within VB for the Crystal Report.) After changing the report from ODBC to OLE it displays a dialog upon execution saying that the "server has not been opened yet"? So... I tried establishing server connection within the code:
Set Report = crxApplication.OpenReport(App.Path & "\Inventory Report.rpt"
'Parameter 1 - Inventory Date
Report.ParameterFields(1).AddCurrentValue (CDate(Format(GetSelectedDate, "yyyy/mm/dd 00:00:00"
))
'Parameter 2 - System
Report.ParameterFields(2).AddCurrentValue ("SYS0" & g_strSystem)
'Establish connection for report using ole
' Report.Database.LogOnServer "pdsoledb.dll", "kcdevsql2k", "PPMS", "ppmstest", "ppmstest"
' Load Page with Crystal Report Viewer Object
Load Form2
Form2.Show
Thanks,
Computergeek
I want to open a Crystal Report in VB without requiring an ODBC DSN connection to be defined for the report. I initially created the Crystal report with an ODBC connection driver and did a Convert Database Driver to use OLE (pdsoledb.dll). (Tried Pdssql.dll did not work very well... lots of errors.) I would like somehow use my existing connection string settings within the VB application to launch the report. (I am using the RDC method within VB for the Crystal Report.) After changing the report from ODBC to OLE it displays a dialog upon execution saying that the "server has not been opened yet"? So... I tried establishing server connection within the code:
Set Report = crxApplication.OpenReport(App.Path & "\Inventory Report.rpt"
'Parameter 1 - Inventory Date
Report.ParameterFields(1).AddCurrentValue (CDate(Format(GetSelectedDate, "yyyy/mm/dd 00:00:00"
'Parameter 2 - System
Report.ParameterFields(2).AddCurrentValue ("SYS0" & g_strSystem)
'Establish connection for report using ole
' Report.Database.LogOnServer "pdsoledb.dll", "kcdevsql2k", "PPMS", "ppmstest", "ppmstest"
' Load Page with Crystal Report Viewer Object
Load Form2
Form2.Show
Thanks,
Computergeek