I have a report on SSRS. I have order and Planned Start column on table. I want to add now the option to order by line or by Planned start time.
I mean if I choose line, our report must be sort for line if I choose planned start time, report must be sort for planned start time
How should I do like this? Could you help me please?
enter image description here
You can create a report parameter called something like "Order By", and make the available values as Line and Planned Start Date. Then, lets say you have a simple report with just one Details group, go into the Group Properties and in the Sort tab, set the sort expression as something like:
=iif(Parameters!OrderBy.Value = "Line",Fields!LineNumber.Value,Fields!PlannedStartDate.Value)
You can add a variable to the SQL script @param then pass it from the parameter just like passing any other parameter. SELECT * FROM table ORDER BY @param
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With