I am using a stored procedure to pull data for the report. In the Standard Report Wizard (Crystal Report XI) data source is selected as a Stored Procedure present in the database. In the next page, the stored procedure is displayed, but the fields selected in the SP are not getting displayed in 'Available Fields' section. Because of this I am not able to add fields to the report.
The query is executed using EXECUTE() method in the stored procedure and the stored procedure is created in the db without any errors/warnings.
Structure of the query in SP goes like this. (Just the framework; correct syntax has been used in the stored procedure)
if(param1 = 'val1')
SET v_val1 = 123
else
SET v_val1 = 456
SET v_query = 'Select a, b, c from tbl where col1=v_val1'
EXECUTE(v_query)
Can anyone please tell me why the fields are not getting displayed?