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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing SSQL Store Procedure Parameter from VB to Crystal

Status
Not open for further replies.

lovalles

IS-IT--Management
Sep 20, 2001
262
US
i have the following situation:
the Source of my report is a Store Procedure that has 2 dates parametes, this SP works fine in the Query Analizer.
Then i make the report on Crystal and the source is the SP. When i make the report preview it prompts for the parameters, then i wenter manually the values i want then the report came ok.
The problem is when i open the report on VB and says:
Crystalreport1.Action=1
there it promps for the parameters but i could enter any value on VB and the report comes with no data?
ANY SUGESTION? WHAT COULD BE WRONG?
 
I'm having exactly the same problem as you. I get the results I want in query analyzer & in crystal design mode but passing the parameters from vb (looks ok in debug) gives me a blank report. Did you ever find a solution?

John.
 
Hi,

This is just a suggestion.
Since you are passing a sored procedure and the problem is(what I understand) when the parameters are prompted. Now create a temporary SP and put your actual SP with parametrs in it. I mean

Creat proc TempProc as
Exec ActualSP Param1,Param2
go.

You have to perform verify database based on this temp. SP and this will eliminate the Parameters from your rpt file.This will eliminate the parameters prompting.
Pass the created TempProc to your Table(item(1)).Location(TempProc) method. Call SetLogOnInfo and connect to the database before calling Location method.

LEt me know what happens.

Cheers,
Techi
 
The solution is to declare the date parameter in the sp as int and convert it to string before passing to crystal.

CREATE PROCEDURE sp_PassDateToCR

@pDate int

AS

SELECT Name
FROM tblNames
Where CreateDate = STR(@pDate)

RETURN

Hope this helps,

John.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top