Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / Reporting Services / February 2007

Tip: Looking for answers? Try searching our database.

grouping and sorting in matrix control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian - 28 Feb 2007 20:11 GMT
I have a dataset returned from sql server that can be represented for the
purpose of this discussion with 2 columns. From the server all the data is
sorted first by column 1 and then by column 2 so that the resultset looks
like the following:
column1, column2, column3
a,  1/1/2007, 10
a,  2/1/2007, 30
a,  3/1/2007, 15
b,  10/1/2006, 5
b,  11/1/2006, 1
b,  12/1/2006, 100
b,  1/1/2007, 10
b,  2/1/2007, 9
c,  11/1/2006, 22
c,  12/1/2006, 33
c,  1/1/2007, 44

When I put this data into a matrix with the dates making the columns and
column1 values for each row I get the following

    1/1/2007  2/1/2007  3/1/2007  10/1/2006  11/1/2006  12/1/2006
a        10            30          15
b        10              9                              5                1  
      100
c        44                                                               22
         33

what I want is the following:
     10/1/2006  11/1/2006  12/1/2006  1/1/2007  2/1/2007  3/1/2007
a                                                             10            
30          15
b             5                1          100             10              9
c                              22           33             44

With the dates sorted. I know I can do it by changing the stored proc but
that opens up all sorts of issues with other things. Is there any way to get
the data looking like I want using reporting services and not modifying the
stored proc?

thanks
EMartinez - 28 Feb 2007 21:02 GMT
> I have a dataset returned from sql server that can be represented for the
> purpose of this discussion with 2 columns. From the server all the data is
[quoted text clipped - 36 lines]
>
> thanks

>From your results, it looks like column2 is sorting aphabetically (I'm
assuming that column2 is not defined as a datetime field in the report
or dataset). You should be able to use the conversion function CDate()
in your sort expression. Something like this should work: CDate(Fields!
column2.Value) and the direction should be ascending. Hope this helps.

Regards,

Enrique Martinez
Sr. SQL Server Developer
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.