I've created a Telerik report and my datasource is pointing to a stored procedure in sql server. However, when executing the report I get the following error:
Procedure or function 'ABC123' expects parameter '@CustomerLocationID', which was not supplied.
When going through the "Configure" option for the datasource, the correct report parameters are mapped to the stored procedure parameters.
When testing the stored procedure call through the "Configure" option, the resultset is returned, as expected, but when running the report through the application, I get the above error. See the attached images for parameter mapping.
5 Answers, 1 is accepted
Please check if you have Glimpse installed, as there is a known issue when using Glimpse and a Telerik Reporting SqlDataSource component with a stored procedure. The Telerik Reporting SqlDataSource component uses NET data providers installed on the machine. The stored procedure parameters will not be passed correctly if Glimpse is installed and modifies the default functionality of those data providers.
We figured out the issue. It was related to "Entity Framework Profiler". To fix the issue I added the following code which disables the tool when not debugging.
Is there any plan on Telerik's part to fix this problem? I'd hate to have to remove Glimpse because I'm using Telerik Reporting.
In general, the EntityDatasource will try to create a context with the given provider and connection string 9and the associated ADO.NET classes). Then data will be retrieved through the data models' methods. Glimpse intersects the work of data providers, which leads to the error when stored procedures expect parameters.
There is an opened issue in github you can follow - Glimpse.ADO + Telerik.Reporting Issues #538.
Please check Data Source Components Problems - "An error has occurred while processing Report 'ReportName': Procedure or function 'StoredProcedureName' expects parameter '@ParameterName', which was not supplied." error on preview, and the suggested workarounds.
Just spent a fair amount of time trying to track down SQL pararmeters passing into stand-alone trdp report. Found the solution on page http://docs.telerik.com/reporting/troubleshooting-data-source-components-configurations#sqldatasource-component where:
Other reason for the error is the usage of Glimpse which prevents the proper execution of StoredProcedure commands. Glimpse can be removed or bypassed by using the 'Select Statement' option of the SqlDataSource Wizard as follows: "exec 'StoredProcedureName' @param1,@param2,..".
solved it for me.