Expression in Parameter

5 posts, 1 answers
  1. Narender
    Narender avatar
    32 posts
    Member since:
    Feb 2016

    Posted 17 Feb Link to this post

    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

  2. Answer
    Stef
    Admin
    Stef avatar
    3036 posts

    Posted 19 Feb Link to this post

    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
  3. DevCraft banner
  4. Narender
    Narender avatar
    32 posts
    Member since:
    Feb 2016

    Posted 04 Mar in reply to Stef Link to this post

    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.

     

  5. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 08 Mar Link to this post

    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
  6. Narender
    Narender avatar
    32 posts
    Member since:
    Feb 2016

    Posted 08 Mar in reply to Stef Link to this post

    Thanks Stef.
Back to Top
DevCraft banner