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!

Crystal Reports and SP's / Cross-Tabs

Status
Not open for further replies.

jjpark75

Programmer
May 3, 2002
15
0
0
US
How do you utilize a stored procedure from MS SQL Server that requires user parameter input in Crystal Reports? Also, any tips on creating a Cross-Tab query in Crystal Reports? Thanks again!

Jung
 
Its very straight forward really

create your sp (ensure you have execute rights)

open Crystal, then using the wizard connect to the database (via one of a number of options e.g. native sql, ole-db or odbc) I have found OLE/ODBC best as thE native sql driver has trouble with large text fields

Once connected choose your stored procedure, once selected you will be prompted to provide a value for each parameter

In many of my reports I have set up the sp with mainly text based parameters (with a default value of '%') and use the parameter in the where clause

e.g.
CREATE PROCEDURE [Country_Report]

@country varchar(50) = '%'
as

SELECT dbo.ClientData.ClientName
from
dbo.ClientData
INNER JOIN
dbo.Country ON
dbo.ClientData.BNYCountryID = dbo.Country.BNYCountryID

WHERE dbo.country.countrydescription like @country

Thus you need to supply, in this case, either % (or a specfic country name e.g. france)

Once you have built your report verytime you refresh it you will be asked whether you want to supply new parameters which you can

I hope this is of some help, sorry I have never used the cross-tab function

Andy
 
Thanks for the help! I'll figure out the cross-tab part...

Jung
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top