Thursday, March 31, 2011

passing parameter of boolean type from SSRS to PL/SQL

Hi,

Could you please tell me if there is a way to pass the parameter of boolean type from reporting services to PL/SQL. I tried using data type boolean in PL/SQL that is not allowing me to create the dataset.

my report is having a radio button , asking for the sort order asc or desc. i was thinking of sorting it from the procedure side. My report is not having any grouping. can i sort the table using this value in SSRS side itself.

please give me an idea

Thanks, Jaz

From stackoverflow
  • One thing you might try if you want to use the parameter value in your SQL statement is have a parameter that you can use to alter the SQL statement. For example, have a string parameter called SortOrder which allows the items (Non-query):

    Value    Label
    --------------------
    ASC      Ascending
    DESC     Descending
    

    Then you can use this to alter your SQL statement. Your SQL statement can be passed as a string so you data source may look something like this:

    ="SELECT * "
    &"FROM MyTable "
    &"ORDER BY SomeField " & Parameters!SortOrder.Value
    

    If you really want to use a radio button, then you could do something like this:

    ="SELECT * "
    &"FROM MyTable "
    &"ORDER BY SomeField " & IF(Parameters!SortOrder.Value, "ASC", "DESC")
    
    Chris Latta : If you set the SQL string manually like this you need to either set the fields up manually (in the fields list, right-click and chose Add) or run the SQL once normally to have the fields set up for you, then turn it into a string like above to include your parameters in the SQL

0 comments:

Post a Comment