Add New Parameters to Stored Procedure Used in Crystal Reports

There is no doubt that SAP Crystal Reports is a great tool for designing and developing reports that could cover almost all business needs. Unfortunately it also has some limitations that cause trouble to developers throughout the development process. In today’s post I explain one of these limitations that I recently encountered and how I managed to overcome it.

For one of our clients who leverages SAP Crystal Reports as a reporting engine, I was required to modify more than 20 existing reports by adding a new filter to reports and respectfully to the underlying stored procedures to reflect changed business needs. Initially the task seemed quite simple but it turned out that SAP Crystal Reports is very sensitive when it comes to changes in stored procedure parameters.

What I did was to alter one of the stored procedures by adding the required parameter. Then I refreshed the report in Visual Studio using the Verify Database command available from Crystal Reports->Database->Verify Database menu (also available from the Field Explorer panel). To my surprise, the result I got was the following error message:

Database Connector Error: ADO Error Code: 0x80040e10
Source: Microsoft SQL Server Native Client 10.0
Description: Procedure or function ‘Report_CollectionAnalysis’ expects parameter ‘@year’, which was not supplied.

ScreenHunter_02 Jan. 02 14.43

Continue reading