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!

Report Parameters vs SP Parameters

Status
Not open for further replies.

sheykc

Programmer
Sep 28, 2001
79
0
0
US
I have managed to finally display my CR (version 7.0) in IE, thru the Java viewer and HTML viewer. However, the data isn't correct.

The report uses a Sybase Stored Procedure with 1 parameter. Previewing the report inside of CR7, and passing the correct value, it works fine.

In my ASP page, I have tried 2 things.

1) I use the Database.Parameters collection, and set the parameter value there with (where strClaimID = "01288CSC0100")

set SPParams = RptDB.Parameters
set SPParam1 = SPParams.item(1)
SPParam1.Value = cstr(strClaimID)

This allowed the report to actually display--but it was displaying data for another claimid. I have no idea where it's getting that claimid!!

2) So, I tried this--I used the Report Parameters collection and used the SetCurrentValue function to attempt to set it there. When I checked the currentvalue of the parameter before SetCurrentValue--it happens to be the claimid that #1 was displaying. After I SetCurrentValue, it still has the incorrect claimid! What gives?

if Not IsObject(session("RptParams")) then
set session("RptParams") = Session("oRpt").Parameterfields
End if

set RptParam1 = session("RptParams").Item(1)
Call RptParam1.SetCurrentValue (cstr(strClaimID), 12)

I am not the original programmer of this CR. In fact, I've just started working with CR this past month. Maybe I'm missing something with the parameters of the report?

I have tried the refresh on the Java viewer--and nothing changes. This is running on IIS 5.0, CR7.0.

Please help!!
 
You need to purchase the book, "Crystal Report 8.5 The complete reference" by George Peck. It has over
850 pages and a CD-Rom. You can't do this on your own.
Howard Hammerman,

Crystal Reports training, consulting, books, training material, software, and support. Scheduled training in 8 cities.
howard@hammerman.com
800-783-2269
 
Can you look at the SQL Query to get an Idea of what is really happening?

Run your report that shows the wrong record.

From the menu, DataBase, Show SQL Query.
Copy and paste this to notepad so you can really debug it if it is really lengthy.

Posibly CR is making the wrong join out of your equi join.

Neve done a Web report, but landing on the wrong record is not limited to the web.

Hth Mike

Mike Davis
MSsql, VB and Crystal Reports Developer
 
Well, I didn't need the book, and I was able to figure it out. Thanks anyway. Once I double-checked the values being passed to the parameters, I just used the Report parameters and it worked fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top