Answered Sorting Matrix report

  • lundi 14 mai 2012 18:30
     
     

    i have matrix report like

    Transaction name

    Month      Date                 trans1        trans2       trans3            TOTAL

    April         4/4/2012            33              11               22                66

    August     8/8/2012             33                11              22                66

    May          5/5/2012             33                 11               22              66

    ---------------------------------------------------------------------------

    i want to sort the main row group  by Date

    April,May,August


    Ahmed Osman

Toutes les réponses

  • mardi 15 mai 2012 09:41
     
     

    no one can sort month by date ,not alphabetic, like 

    Month

    April

    May

    August



    Ahmed Osman

  • mercredi 16 mai 2012 07:36
     
      A du code

    Hi Ahmed Osman2,

    What kind of control are you using to show the data, you could use SortDescriptions to complete the sorting. 

    ICollectionView dataView = CollectionViewSource.GetDefaultView(myDataGrid.ItemsSource);
    dataView.SortDescriptions.Clear();
    dataView.SortDescriptions.Add(new SortDescription(strPropertyName, paramDirection));
    dataView.Refresh();

    Best regards,


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • mercredi 16 mai 2012 11:17
     
     

    Hi Ahmed Osman

    There are three ways to sort your report.

    1) If you want to do it UI: You can populate your report in a Datagrid. Bind your report collection to the Data Grid. When you click on the the Column Header, all the rows are sorted.

    2) In business logic: After retrieving your collection from database, use some logic to sort like:

    var sortedCollection = MyCollection.OrderBy(p => p.Date).ToList();

    3) While retrieving your result from the database, modify the query and use ORDER BY clause to sort the collection by Date.

    Mark as Answer, if it solves your query.

    Thanks


    Murali Mahendra Banala

  • dimanche 20 mai 2012 11:52
     
     

    thanks Sheldon _Xiao

    i used microsoft    report wizard (Reporting)


    Ahmed Osman

  • dimanche 20 mai 2012 12:58
     
     

    Thanks Murali Mahendra Banala fro you effort,

    but i use Procedure order by date, in preview data oky but in report sort alphabetic .


    Ahmed Osman

  • mardi 22 mai 2012 02:40
     
     

    Hi Ahmed Osman2,

    Since your question is not about Windows Presentation Foundation(WPF), I will be moving this thread to Where is the Forum for... forum to help you find the appropriate forum for your question.

    Have a nice day!


    Min Zhu [MSFT]
    MSDN Community Support | Feedback to us

  • mardi 22 mai 2012 07:39
    Propriétaire
     
     

    What software? Is this SQL?

    Thanks!


    Ed Price (a.k.a User Ed), SQL Server Experience Program Manager (Blog, Twitter, Wiki)

  • mardi 22 mai 2012 11:20
     
     

    thanks ED 

    this is VS 2010   ,SQL 2008, Report (wizard )


    Ahmed Osman

  • mardi 22 mai 2012 15:24
     
     

    Thanks Min Zhu

    if  this will help solve problem  ,i hope


    Ahmed Osman

  • lundi 28 mai 2012 17:11
    Propriétaire
     
     Traitée

    thanks ED 

    this is VS 2010   ,SQL 2008, Report (wizard )


    Ahmed Osman

    Then try here: http://social.technet.microsoft.com/Forums/en-US/sqlreportingservices/threads

    Thanks!


    Ed Price (a.k.a User Ed), SQL Server Experience Program Manager (Blog, Twitter, Wiki)