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

Passing parameters into SQL string not working

3 Answers 178 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 2
Joe asked on 14 Jan 2019, 06:31 PM

Hi all,

I'm new to Telerik Reporting so forgive me for my ignorance. I read this article about using SQL parameters in a report: 

https://docs.telerik.com/reporting/sql-data-source-using-parameters

But I can't get it to work and I'm wondering what I'm doing wrong. I have a simple query that looks something like this:

<p>"SELECT order_date, order_cost, order_customer</p><p>FROM orders</p><p>WHERE order_date = @OrderDate"</p>

And I set the Parameter in the database connection Name: @OrderDate; Db Type: Date; Value: = Parameters.Order_Date.Value

In the report, I created one ReportParameter, and I called it "Order_Date". It is set to AutoRefresh: True; Type: DateTime; Value: 1/6/2019; Visible: True.

When I try to execute the query from within the SQL box where I enter the parameter information, it works. But when I try to Preview the report, the wheel just turns forever and nothing ever displays and I get no error. Can someone help me figure out what I'm doing wrong? 

3 Answers, 1 is accepted

Sort by
0
Joe
Top achievements
Rank 2
answered on 14 Jan 2019, 07:35 PM
UPDATE: Well, I waited a half-hour for the wheel to finish turning, and it just showed me the table repeating like 100 times. What am I doing wrong?
0
Joe
Top achievements
Rank 2
answered on 14 Jan 2019, 08:22 PM
I solved this on my own. What I needed to do was remove the DataSource from the Report. 
0
Silviya
Telerik team
answered on 15 Jan 2019, 07:12 AM
Hi Joe,

Yes, this is one of the approaches to get rid of the repeating Tables. If you wish, you could also move the Table to a report section that doesn't duplicate - such as group headers or footers of a static group.

Regards,
Silviya
Progress 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
Tags
General Discussions
Asked by
Joe
Top achievements
Rank 2
Answers by
Joe
Top achievements
Rank 2
Silviya
Telerik team
Share this question
or