I am developing a vb 6 app that calls a Crystal 7 report using OCX. The Crystal Report contains a Stored Procedure. The Report works fine when I am in Crystal, but when I call the report using OCX I get the data to display but no data retrieved. I have tried various methods for connecting to the database and passing the stored procedure, but to no avail.
I am able to get data in following situation. I check on the save data with report option in the crystal report and then I pass the same value via ocx that it was saved with and then the data is displayed. If I pass another value it displays the report but with no data.
Here is my code:
With CrptLPNTag
.Reset
.ReportFileName = "c:\windows\desktop\test.rpt"
.DiscardSavedData = True
.Connect = "DSN=TIM;UID=reportuser;PWD=password;DSQ=RSSMain"
'Note I also tried these connection strings to no avail.
'i = .LogOnServer("Pdssql.dll", "TIM", "RSSMain", "reportuser", "rome3117"
.StoredProcParam(0) = gPrintLPN
.Destination = crptToWindow
.Action = 1
End With
In the report I have tried both using both of the following set location properties to no avail also "RSSMain.dbo.Proc(LPNTag)" and "Proc(LPNTag)"
This stored procedure is pretty basic and I can get around the problem by just joining the tables in crystal, but I have other reports to create that will need to use Stored procedures so any help will be much appreciated!
Thanks in advance for your help
I am able to get data in following situation. I check on the save data with report option in the crystal report and then I pass the same value via ocx that it was saved with and then the data is displayed. If I pass another value it displays the report but with no data.
Here is my code:
With CrptLPNTag
.Reset
.ReportFileName = "c:\windows\desktop\test.rpt"
.DiscardSavedData = True
.Connect = "DSN=TIM;UID=reportuser;PWD=password;DSQ=RSSMain"
'Note I also tried these connection strings to no avail.
'i = .LogOnServer("Pdssql.dll", "TIM", "RSSMain", "reportuser", "rome3117"
.StoredProcParam(0) = gPrintLPN
.Destination = crptToWindow
.Action = 1
End With
In the report I have tried both using both of the following set location properties to no avail also "RSSMain.dbo.Proc(LPNTag)" and "Proc(LPNTag)"
This stored procedure is pretty basic and I can get around the problem by just joining the tables in crystal, but I have other reports to create that will need to use Stored procedures so any help will be much appreciated!
Thanks in advance for your help