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

Using MSSQL Stored Procedures in Crystal XI

Status
Not open for further replies.

chriscboy

Programmer
Apr 23, 2002
150
GB
Hi,

I am an experienced user of XI, but new to MSSQL. I am trying to create a simple report which uses a table and a stored procedure.

The table contains the following fields to store results:
ResultID,EmployeeID,Result

The stored procedure usp_GetUsers returns a list of userss:
EmployeeID,UserName

I have added the table and SP and linked the two using the field EmployeeID in the linking expert:

In the main report I have the following fields
Table.ResultID,Table.EmployeeID,usp_GetUsers.UserName


WHen I run the report back I get the following information:

Table.ResultID Table.EmployeeID usp_GetUsers.UserName
============== ================ =====================
1 1 chris
2 1 chris
3 1 chris
4 1 chris
5 2
6 2
7 2

If i create a separate report on usp_GetUsers i get the following information:

EmployeeID UserName
========== ================ =====================
1 chris
2 adam
3 lara


The question is when running the report why does 'adam' not appear? He is in the usp_GetUsers results set, so I would expect it to be display.

Can you use SPs in this way, or have I done something wrong?

Thanks

Chris
 
Hi,
Check the datatypes and the length ( as well as any possible blank-padding) between the table's ID and the SP's ID fields..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,

I reversed the link in the visual linking expert and that appears to have resolved the issue.

Regards

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top