Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Integrate VB6 with CR10 Using Sybase Stored Proc as DataSource

Status
Not open for further replies.

pamelarj

Programmer
Sep 8, 2005
14
US
I currently have a VB6 application that uses CR9 References (Crystal Report View Control 9 and Crystal Reports 9 ActiveX Designer Run Time Library). I have to transition the application to use CR10 References (Crystal ActiveX Report Viewer Library 10, Crystal Reports ActiveX Designer Design and Run Time Library 10.0, Crystal ActiveX Designer and Run Time Library 10.0).

The report integrates an external .RPT file. The datasource for the external .RPT file is a Sybase (v 12.5.03 - 32bit) stored procedure . The current version of the VB application uses the following code to fire off the report and export it in PDF format to our server:

Code:
Dim fsoPDF
Set fsoPDF = CreateObject("Scripting.FileSystemObject")
            
Set appl = New CRAXDRT.Application
Set crptAdvice = New CRAXDRT.Report
Set crptAdvice = appl.OpenReport ("c:\Crystal\Advice.rpt")

crptAdvice.Database.Tables(1).ConnectionProperties("User ID") = gstr_UID
crptAdvice.Database.Tables(1).ConnectionProperties("Password") = gstr_PWD

'Refresh the Crystal Report source data
crptAdvice.DiscardSavedData

'Passing parameters to Sybase stored proc
crptAdvice.ParameterFields.GetItemByName("@pPlanID")._
           ClearCurrentValueAndRange

crptAdvice.ParameterFields.GetItemByName("@pPlanID")._
           AddCurrentValue gPlanID
            
With crptAdvice.ExportOptions
   .DestinationType = crEDTDiskFile
   .FormatType = crEFTPortableDocFormat
   .DiskFileName = strPDF_Path & strPDF_FileName
End With

crptAdvice.Export False 'Export pdf file; turn off export module
The problem is that now that I've changed the references to the CR10 References listed above, while the PDF file does export, there are no results. It's as if the CR doesn't make the connection to the Sybase Server and thus doesn't return the results from the stored proc.

Any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top