This is a migrated thread and some comments may be shown as answers.

Parameters in Q3.2015

2 Answers 86 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mateusz
Top achievements
Rank 1
Mateusz asked on 23 Dec 2015, 09:31 AM

Hello,

Few days ago, my customer asked me to modify his reports (he has like 70) created like 2 years ago with Report Designer. Just at the beginning I have encountered an error connected with passing parameters and i do not know the cause. On one of my computers, where I have Windows 10 and Q3.2015 i cannot pass a parameter to a stored procedure and by cannot i mean:

- in database there is a procedure dbo.proc which is expecting parameter @ID

- In Report Designer, after chosing stored procedure as data source I create data source parameters by adding parameter ID and i set its design time value to some number. 

- Then i click Execute Query, the popup window of Parameter Values Editor is being shown and just as i click OK I receive an error message:

"ERROR[42000] ....  Procedure or function 'proc' expects parameter '@ID', which was not supplied. "

 

I have found some info about this being connected with Glimpse, but I do not have anything like that installed (in fact, I only have Telerik products as extensions to VS). What is more,I can edit the same report without any problem on my other PC where I have Windows 7. What can be the cause of this problem? How can i trace it down to the source?

 

The other problem is also connected with Parameters, but this time it does not work on both Win10 and Win7. I am editing a data source of existing report (so it was working in previous versions of Telerik Report Designer - I have checked and it is working on Q2.2015). If I create Data Source based on SELECT statement like this:

SELECT column1, column2 FROM dbo.Table WHERE ID = @Param 

clicking "Next" brings me straight into Preview Data Source Results window and Executing Query show an error "Must declare the scalar variable "@Param". "

On Q2.2015 if you click Next in the same situation "Configure data source parameters" window will be shown and after that "Configure design time parameters", which in the end allows you to have a SELECT based data source with parameters declared in this way.

I know i can do it like this:

SELECT column1, column2 FROM dbo.Table WHERE ID = ?

and then declare parameters in exact order but if you have more of them it is not friendly for editing. 

 Can i get any help in any of those issues? Now i would have to edit sources for all the reports and due to the fact that some other customers are also using this I do not like the situation when I have to change everything just because something which was working is not supported anymore (or maybe it is?).

 

Regards,

Mateusz

 

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Stef
Telerik team
answered on 25 Dec 2015, 03:09 PM
Hi Mateusz,

Please test the following:
  1. Please download and install the latest available Telerik Reporting Q3 2015 SP2 v9.2.15.1216 (internal build). The MSI can be downloaded from your Telerik account -  Products & Subscriptions - Latest internal builds. Once installed, upgrade all projects.
  2. On configuring the SqlDataSource component, map the SQL parameters to report parameters at "Configure data source parameters" step. The next step is "Configure design time parameters" where you can provide exact values, which will be used only for previewing the result in the SqlDataSource wizard, and for obtaining the data schema (fields).
    On report preview, the SQL query will be executed with the values provided by the corresponding report parameters.
  3. If SQL parameters are not listed on configuring the SqlDataSource component, please test using other .NET data provider.
    In general, the SqlDataSource uses the connection string, SQL query and .NET data provider to establish a connection and to retrieve data. It is the .NET data provider which interprets the SQL query and how parameters are declared or passed. Thus the SQL query syntax must be considered with the selected .NET data provider.
    When the wizard does not receive information for parameters in the SQL query, you can test to configure manually the SqlDataSource.Parameters collection, after finishing with the SqlDataSource Wizard.


I hope the provided information is helpful.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mateusz
Top achievements
Rank 1
answered on 28 Dec 2015, 03:43 PM

Hello Stef,

 I have downloaded version suggested by You and it has solved an issue connected with my PC that is running Windows 10 - now i can pass parameters to procedures without any problem on this machine and my Data Source is working as intended.

When it comes to parameters you are right again - I did not notice that after changing my test server i have created new connection with ODBC data provider and the previous one was SqlClient.

 

Thank you for Your time and all the best!

Mateusz

 

 

Tags
General Discussions
Asked by
Mateusz
Top achievements
Rank 1
Answers by
Stef
Telerik team
Mateusz
Top achievements
Rank 1
Share this question
or