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

Expression in Parameter

4 Answers 531 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Narender
Top achievements
Rank 1
Narender asked on 17 Feb 2016, 12:55 PM

Hi All,

I am new in Telerik .

I am creating a report in report designer and taking data from query string from datasource like:-

select Id from table1 where (year(enter_date)=@year)

 

So

1) I have to set a expression in this parameter means show all year in drop down box  in run time and when i select the one year then all report changes according to that.

 Please tell me how to set an expression in this parameter?

 

I have seen the example of dashborad in whichi have seen this parameter of year but didnt get it  from that example.

 

 

 

Thanks,

 

Narender

4 Answers, 1 is accepted

Sort by
0
Accepted
Stef
Telerik team
answered on 19 Feb 2016, 09:09 AM
Hi Narender,

Please follow the steps from the How to: Cascading Parameters with applied filtering on data source level tutorial. It illustrates how to create cascading parameters e.g. one controlling parameter which value is used in the SQL query of a second report parameter's available values. In the tutorial the second parameter is used to filter the data of the report.


Let us know if you have any further questions.

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
Narender
Top achievements
Rank 1
answered on 04 Mar 2016, 07:45 AM

Thank you Stef.Its really heplful.

But i have a doubt.

when i use this query in my datasouce then my report is showing error : invalid parameter value.

select rowid,appType,appLotNo,appAggrementDate from table where appType=@appType 

 

But when i add "OR @appType is null" in where clause then my report  running fine.

select rowid,appType,appLotNo,appAggrementDate from table where appType=@appType OR @appType is null

 

Could you tell me the reason behind this .Also i dont want to use "OR @appType is null" condition in where clause.

 

0
Stef
Telerik team
answered on 08 Mar 2016, 08:54 AM
Hello Narender,

Please check the settings of the report's SqlDataSource component and the report parameter mapped to the @appTypeSQL parameter - Using Parameters with the SqlDataSource component. If the report parameter's AllowNull is set to true, the report can send Null value to the SQL query and the value has to be handled by the query. For examples check the following codeproject article: Handling NULL in T-SQL.

The SQL query can be tested and modified in MSSQL Server Management Studio. You can also run SQL Profiler to check the queries executed on running the report, and the parameters' values passed by the report and used by the query.


I hope this 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
Narender
Top achievements
Rank 1
answered on 09 Mar 2016, 05:30 AM
Thanks Stef.
Tags
Report Designer (standalone)
Asked by
Narender
Top achievements
Rank 1
Answers by
Stef
Telerik team
Narender
Top achievements
Rank 1
Share this question
or