I am very green with reporting in general.
I am using VS2013 to design a simple report.
- I created a report and a data source.
- I added a report parameter and a data source to show a list of available values.
My question:
1) How do I take the report parameter and tie it to my data source?
For example the data source is simple "SELECT * FROM BOOKS"
I would like to set up as "SELECT * FROM BOOKS WHERE BOOK_TYPE = [MY PARAMETER]"
I manually added the following to my SelectCommand for the data source
SELECT * FROM BOOKS WHERE BOOK_TYPE == Parameters.ReportCodeParam.Value
However that didn't work.
On the data source I also see a Parameters property. When I go to that property I don't see the parameter that I created on the report.
Please advise.
5 Answers, 1 is accepted

I was able to create a parameter in the datasource and link it's value to the report parameter that I created.
However I'm still stuck on tying that parameter back to the sql statement.

Dear Jim,
have you already seen this in the documentation?
http://docs.telerik.com/reporting/designing-reports-parameters-programmatic-control
Kind regards
Martin
If the report already has report parameters configured you can map them to data source parameters - check Using Parameters with the SqlDataSource component and SqlDatasource Wizard(step 4) for more detailed information.
After that, you can use this parameter in the SQL query as following:
SELECT
*
FROM
Books
WHERE
BookType = @BookType
I hope this information will help.
Regards,
Katia
Telerik by Progress

This is what I have tried:
- I added a parameter to the sqlDataSource
- I configured the sqlDataSource to use that parameter.
i.e. Changed the select command to:
SELECT field1, field2, field3 FROM MyTable
WHERE MyCode = @ReportType
- Rebuilt the solution.
When I click the "Preview" tab I enter my parameter.
I then get an error: ORA-00936 missing expression on the report.
Please advise.
Check if SQL query follows the syntax for the selected database engine.
If you are working with SQL Server the parameter name begins with the '@' character and this name should correspond to the name of the report parameter.
For Oracle databases, the parameters are prefixed with the ':' character and for ODBC or OLE DB databases, parameters are not named and are specified with the placeholder character '?'.
For more information, check Using Parameters with the SqlDataSource component help article.
Regards,
Katia
Telerik by Progress