Hi,
This is my first foray into the Telerik Reports so please excuse my lack of knowledge. I am attempting to develop a report where the user can enter a start date and an end date. I am connecting to a SQL 2008 Data Source and running SQL similar to this:
SELECT COUNT(*) AS ProductCount, ProductDescription, StateCode
FROM ProductSales
WHERE (SaleDate > @StartDate) AND (SaleDate <= @EndDate)
GROUP BY ProductDescription, StateCode
ORDER BY StateCode, ProductDescription
When I step through the designer wizard I can connect to the data source without a problem, can add the sql without a problem, define the parameters without an issue, can set the parameters and view the results of the SQL and finish/create the report.
So I have a report with the above SQL contained in it. OK...now I need to set the parameters so I go into the designer, select the report and edit the properties. In the ReportParameters it has No ReportParameters so I go and add 2...
Name: StartDate
AllowBlank = false
Visible = true
Type = DateTime
Name: EndDate
AllowBlank = false
Visible = true
Type = DateTime
Then I save the file and build the project. All goes well and when I preview the report indeed the StartDate and EndDate inputs are there. I select the same (or any other) dates that I chose when I ran the wizard above and click the preview button. The report is generated but no data is returned. It is like the report totally ignores the parameters.
If I code into the SQL the dates the report works fine. I think I am doing something wrong with the parameters in the SQL...there they are @StartDate etc. and in the parameters editor I enter StartDate (can't enter the @StartDate as it is invalid).
In a nutshell I can see the data in the wizard or if I hard code the dates but once I get to the designer I cannot see them. Any thoughts on what I am missing? Your assistance is appreciated!
Thanks in advance,
Kelvin
This is my first foray into the Telerik Reports so please excuse my lack of knowledge. I am attempting to develop a report where the user can enter a start date and an end date. I am connecting to a SQL 2008 Data Source and running SQL similar to this:
SELECT COUNT(*) AS ProductCount, ProductDescription, StateCode
FROM ProductSales
WHERE (SaleDate > @StartDate) AND (SaleDate <= @EndDate)
GROUP BY ProductDescription, StateCode
ORDER BY StateCode, ProductDescription
When I step through the designer wizard I can connect to the data source without a problem, can add the sql without a problem, define the parameters without an issue, can set the parameters and view the results of the SQL and finish/create the report.
So I have a report with the above SQL contained in it. OK...now I need to set the parameters so I go into the designer, select the report and edit the properties. In the ReportParameters it has No ReportParameters so I go and add 2...
Name: StartDate
AllowBlank = false
Visible = true
Type = DateTime
Name: EndDate
AllowBlank = false
Visible = true
Type = DateTime
Then I save the file and build the project. All goes well and when I preview the report indeed the StartDate and EndDate inputs are there. I select the same (or any other) dates that I chose when I ran the wizard above and click the preview button. The report is generated but no data is returned. It is like the report totally ignores the parameters.
If I code into the SQL the dates the report works fine. I think I am doing something wrong with the parameters in the SQL...there they are @StartDate etc. and in the parameters editor I enter StartDate (can't enter the @StartDate as it is invalid).
In a nutshell I can see the data in the wizard or if I hard code the dates but once I get to the designer I cannot see them. Any thoughts on what I am missing? Your assistance is appreciated!
Thanks in advance,
Kelvin