none
How to sort integer value in SSRS report?

    Question

  • I am creating a SSRS report.

    I have a inline query where i will get the result of an integer valu in desc order.

    but when i try the same query i am not getting the order is messed up.

    my query result is :

    name    id

    xxx        6

    aaa        5

    ccc        4

    yyy       2

     

    BUt in SSRS report it is taking name in alphabetical order.but i gave in inline query as 'id' order by desc.

    please help me how to sort this.thanks

    Wednesday, October 19, 2011 10:57 AM

Answers

  • Hi,

     

    Try to follow these simple steps. Double click on Detail Group(you can see it from Row Groups). Now you are able to see Group Properties. Here click on Sorting then click on Add now select Id in column tab for Sort by. Now main thing is that below order tab Z to A must be selected instead of A to Z. Now finally click on OK. Hope I have answered you correctly.


    Cheers!! Sumit
    Thursday, October 20, 2011 4:20 AM

All replies

  • when you drag and drop the name to a matrix, then a group is automatically created. If you right click on the group and select group properties, you can see that there is a Sort tab. Click on that and delete the default sorting (which would be based on alphabetical order). Now it will show in the way you want. 

    Alternatively, you can sort it in the report by the id.


    Cheers,
    Jason
    P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)

    Some Random Thoughts

    Wednesday, October 19, 2011 11:00 AM
  • Hi,

    I removed that Sort option but still it is showing.

    I got the reason i have grouped the name field in ssrs report. because of that it is giving us the result for name in alphabetical order.

    but i need the drilldown option for name so that i can cal subreport by giving the name as parameter.

    i feel i need to sort only id value in an expression.pls tell me how to do  that.

    i tried converting

    =CStr(Fields!ID.Value)  but still i am not getting the result.pls help me out.

    thanks,

    Thursday, October 20, 2011 3:52 AM
  • I removed that Sort option but still it is showing.


    Hi SQL

    Just need to put which field you wnat the sorting in group sorting expression. see the below Scree. If you still face same issue then try the Table lavel sorting option not a Group level sorting option.

     You Need to give Prder either A to Z or Z to A


    SUHAS http://suhaskudekar.blogspot.com/ Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.
    Thursday, October 20, 2011 4:14 AM
  • Hi,

     

    Try to follow these simple steps. Double click on Detail Group(you can see it from Row Groups). Now you are able to see Group Properties. Here click on Sorting then click on Add now select Id in column tab for Sort by. Now main thing is that below order tab Z to A must be selected instead of A to Z. Now finally click on OK. Hope I have answered you correctly.


    Cheers!! Sumit
    Thursday, October 20, 2011 4:20 AM