0
votes

I'm currently attempting to fix an issue with a Crystal Report/SQL stored procedure related to certain rows returned from a stored procedure not displaying.

A little background: A stored procedure gets records from a certain table and includes a WHERE clause that matches against two foreign keys in the table. The crystal report displays the rows returned from this procedure. An issue arose, where data being entered into the table may lack one of the given foreign keys. The stored procedure would then fail to return that row.

A decision was made to alter the stored procedure WHERE clause to only match against one of the keys (the one the row is guaranteed to have). It is not currently remembered why it was a requirement to check the other key, the reason is lost to time. :/

In any case, the change was made, however the affected rows did not appear. When the stored procedure was ran directly, the correct output was seen.

My question: Is there a way to restrict a result set from within a Crystal Report based on the value of a field, similar to a WHERE clause in a SQL query, and might this be causing certain records to not display in the report?

Additionally: Any other reasons the whole result set might not be displayed? Places to check?

I'm a complete Crystal Reports newbie.

2
So, there's been a development. The report was using two stored procedures to return different information. I had no idea they were linked in any way, but there was some kind of join going on when you looked in the Database Expert. It seems that's what necessitated both keys. I hesitate to put this as the answer, because I still have no idea what's going on in a concrete sense. However, the problem is solved, so thanks for all the help. If anybody can think to explain how a join between two stored procedures works, I'd love to have that as an answer to this question. Thanks. - Scott Oliver

2 Answers

0
votes

are the tables correctly linked? Sounds like this could be a INNER JOIN vs OUTER JOIN issue.

the part about restricting a result from within crystal - If I understand this correctly you need to use the select expert. Choose the field in question and choose something like "is not equal to" and put the value in.

0
votes

since you can see the records returned from stored procedure... below are few points that will help you:

  1. select expert in crystal report works as where clause... So if you want the limit the data to the report then you can place your conditions in select expert.
  2. If you are using parameters in the report and value in parameter is not matching with the data returned by stored procedure then also CR will be blank.
  3. Check the database connection to crystal report whether you are connecting to correct database or not.