Crystal Reports - Certain output from SQL not disp

2019-09-01 14:43发布

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条回答
三岁会撩人
2楼-- · 2019-09-01 15:01

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.
查看更多
小情绪 Triste *
3楼-- · 2019-09-01 15:11

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.

查看更多
登录 后发表回答