I looked around quite a bit but couldn't get around to the issue I've at hand. I've a matrix report with one row group and one column group. I want to apply interactive sort so that when a user clicks on the column header based on the values in the column the report is rearranged.
The report shows:
Name 02/02/2008 01/31/2008
Test1 15 12 Test2 9 15
Now if the user clicks on 02/02/2008 then it will show Name 02/02/2008 01/31/2008
I'm trying to implement Interactive Soring on the column headers in a matrix in a report. Is it actually possible to do this? I've read several internet posts and stories of implementing the Interactive Sorting in the upper-left corner of the matrix, but this is not what I want, I want to implement it on the column headers .
The goal I'm trying to achieve is to give the user the possibillity to click on a column header to sort the rows below in asc- or descending direction.
Please tell me if this is possible, because all my efforts have not been succesfull! If it's possible, please provide the solution to do this.
If you need more information, please don't hesitate to ask.
I just can not understand why when I add text to a group header the report displays more group row space but when I export to excel the extra space disappears....
Hello Guys, I am working on a matrix report which has several row groups and 1 column group. After execution, the column group wil end up with several columns containg numeric counts. I would like to have the grand total for each "column group" column as a last row on this report. For row groups you can just right click "Subtotal", but that is not possible for column group. Could someone please help me to find a clever way of accomplishing this, please. Thank you so much for your help!
I'll try to make this simple. I'm on SSRS 2005 and I have a report with a matrix object that has one row group and one column group. I need to switch the number format only for values where the column group has a specific value.
For example, here are the records in the table: Customer, Type, Amount Customer1, Revenue, -100 Customer2, Cost, 60 Customer1, Revenue, -200 Customer2, Cost, 125
By default the matrix object shows the following (the total comes from the standard subtotal on the column group): Revenue Cost Total Customer1 -100 60 -40 Customer2 -200 125 -75
But the users need the report to look like this, with all positives (why, oh why?! ): Revenue Cost Total Customer1 100 60 40 Customer2 200 125 75
I was able to use the inscope function to switch the signs of the Total numbers. But now I need to switch the signs of the Revenue column from negative to positive (and vice versa), without affecting the signs of the Cost column. It's strange to me because I CAN switch the signs for a specific row group (changing Customer1's number format, without affecting Customer2's format) using something like this:
But a similar expression specifying a column group value does not work, because the report seemingly doesn't recognize the value of the column group at all no matter what I do:
The other reason why this is strange is that I've done drill-through reports off of matrix objects where specific column group values (the ones clicked on) can be passed into the drill-through report parameters. So it recognizes the column group values upon drill-through, but not for formatting?
How else can I do this? I must be missing something here. Thanks.
I have 2 higher level column groupings of month name and year above my actual date groups. It looks a little weird aligning them left but there is no guarantee that centering them will even allow them to show until I've scrolled right to the middle of the cell width that they occupy.
Is there a feature that comes with, or a well known trick for making them center in the area that is being viewed instead of the potentially very wide cell that they occupy?
I am trying to set sorting up on a DataGrid in ASP.NET 2.0. I have it working so that when you click on the column header, it sorts by that column, what I would like to do is set it up so that when you click the column header again it sorts on that field again, but in the opposite direction. I have it working using the following code in the stored procedure: CASE WHEN @SortColumn = 'Field1' AND @SortOrder = 'DESC' THEN Convert(sql_variant, FileName) end DESC, case when @SortColumn = 'Field1' AND @SortOrder = 'ASC' then Convert(sql_variant, FileName) end ASC, case WHEN @SortColumn = 'Field2' and @SortOrder = 'DESC' THEN CONVERT(sql_variant, Convert(varchar(8000), FileDesc)) end DESC, case when @SortColumn = 'Field2' and @SortOrder = 'ASC' then convert(sql_variant, convert(varchar(8000), FileDesc)) end ASC, case when @SortColumn = 'VersionNotes' and @SortOrder = 'DESC' then convert(sql_variant, convert(varchar(8000), VersionNotes)) end DESC, case when @SortColumn = 'VersionNotes' and @SortOrder = 'ASC' then convert(sql_variant, convert(varchar(8000), VersionNotes)) end ASC, case WHEN @SortColumn = 'FileDataID' and @SortOrder = 'DESC' THEN CONVERT(sql_variant, FileDataID) end DESC, case WHEN @SortColumn = 'FileDataID' and @SortOrder = 'ASC' THEN CONVERT(sql_variant, FileDataID) end ASC And I gotta tell you, that is ugly code, in my opinion. What I am trying to do is something like this: case when @SortColumn = 'Field1' then FileName end, case when @SortColumn = 'FileDataID' then FileDataID end, case when @SortColumn = 'Field2' then FileDesc when @SortColumn = 'VersionNotes' then VersionNotes end
case when @SortOrder = 'DESC' then DESC when @SortOrder = 'ASC' then ASC end and it's not working at all, i get an error saying: Incorrect syntax near the keyword 'case' when i put a comma after the end on line 5 i get: Incorrect syntax near the keyword 'DESC' What am I missing here? Thanks in advance for any help -Madrak
I making a report using Matrix with 2 row groups and 1 column group. The group names are:
Row : CompanyName, TotalUsers
Column: UserType
Detail Group has a count of number of user in each type.
I want to use interactive sort feature on my column group so that when I click on my column header, it sort my detail group data ascending or decending and companyName and total users based on datail group.
I'm having problem with sorting in matrix. My report looks something like below.
Name* Avg.* | Test1 Test2 Test3 ============================================== Jim 50% | 100% 40% 10% John 28% | 5% 40% 40%
The column with * need to be sorted. I can sort the name and average fine in Microsoft SQL Server Reporting Services Version 9.00.2047.00. BUt when I run this in another environment, sorting on Avg doesn't work. The version on that is Microsoft SQL Server Reporting Services Version 9.00.3054.00.
I put together a sample code against the northwinddatabase. Sorting works in 9.00.2047.00 but not 9.00.3054.00. Any ideas??
This must be a first, something that works in pdf, but not in html view....
I have 3 interactive sorts on 3 row groupings in a Matrix
When sorting the data in the 'preview' tab of report designer, all works well. On deploying the reports and trying to sort, I find that the report contains huge areas of white space (1 very wide empty column) and no data whatsoever, although the row grouping labels are present. Upon exporting to PDF all is ok.
I got the following code to add a column in a matrix with a variance:
IIF(IsNothing(Previous(Sum(Fields!Amount.Value))) or Fields!year.Value=First(Fields!year.Value,"Category") or Previous(Sum(Fields!Amount.Value))=0,nothing, ( (Fields!Amount.Value) /Previous(sum(Fields!Amount.Value)) ) )
This code works fine, except that the first row of the matrix shows an #error
This happens with each matrix where I use this expression. A warning emerges:
rsruntimeerrorinexpression the value expression for the textrun Textbox43.Paragraphs[0].TextRuns[0]' contains an error.
Attempted to divide by zero.
The strange thing is that the part
Fields!year.Value=First(Fields!year.Value,"Category") should prevent an error and I expect it to show 'nothing'
An screenshot of the table. (each color is a different category. Each row stands for 2013, 2014, 2015)
As you can see, all other 2013 rows show a blank cell, except the first row.
I have an SSRS 2012 table report with groups; each group is broken ie. one group for one page, and there are multiple groups in multiple pages.
'GroupName' column has multiple values - X,Y,Z,......
I need to group 'GroupName' with X,Y,Z,..... ie value X in page 1,value Y in page 2, value Z in page 3...
Now, I need to display another column (ABC) in this table report (outside the group column 'GroupName'); this outside column itself is another column header (not a group header) in the table (report) and it derives its name partly from the 'GroupName' values:
Example:
Value X for GroupName in page 1 will mean, in page 1, column Name of ABC column must be ABC-X Value Y for GroupName in page 2 will mean, in page 2, column Name of ABC column must be ABC-Y Value Z for GroupName in page 3 will mean, in page 3, column Name of ABC column must be ABC-Z
ie the column name of ABC (Clm ABC) must be dynamic as per the GroupName values (X,Y,Z....)
Page1:
GroupName Clm ABC-X
X
Page2:
GroupName Clm ABC-Y
Y
Page3:
GroupName Clm ABC-Z
Z
I have been able to use First(ReportItems!GroupName.Value) in the Page Header to get GroupNames displayed in each page; I get X in page 1, Y in page 2, Z in page 3.....
However, when I use ReportItems (that refers to a group name) in the Report Body outside the group,
I get the following error:
Report item expressions can only refer to other report items within the same grouping scope or a containing grouping scope
I need to get the X, Y, Z ... in each page for the column ABC.
I have been able to use this - First(Fields!GroupName.Value); however, I get ABC-X, ABC-X, ABC-X in each of the pages for the ABC column, instead of ABC-X in page 1, ABC-Y in page 2, ABC-Z in page 3, ...
I have a table that most of the data has the same value, but there are only a few that do not match that value. I want to populate a listbox with all values from the table, but I'd like to have the majority listed first, followed by the others (the few that don't matach). What's the best way to approach this with SQL?
need some sql assistance....have this: Model Date A 2/2/07 B 1/2/07 C 1/1/07 A 3/1/07 C 2/2/07
I think you get the idea....random.... I need sorted by Model that's important - but then with lowest date first:
C 1/1/07 C 2/2/07 B 1/2/07 A 2/2/07 A 3/1/07
have the ability to create a control column if that helps...but am struggling with the sql statement that will give me the correct results and would welcome input....thanks in advance...
I am doing a running 12 month Sales report. Invoice totals are summed. I want to Group By Location and Customer. I would also like to do a Top 20 customers for each location. Here is what I have so far and it comes back with a failure of Invalid column name 'Location'.
I don't know how to do the Top 20 either. Any help would be appreciated. Thanks.
SELECT SUM(CASE WHEN DATEDIFF([MONTH], ih.SOTransDate, GetDate()) = 0 THEN id.SOExtChargeAmount ELSE 0 END) AS CurrentMonth, SUM(CASE WHEN DATEDIFF([MONTH], ih.SOTransDate, GetDate()) = 1 THEN id.SOExtChargeAmount ELSE 0 END) AS MonthLessOne, SUM(CASE WHEN DATEDIFF([MONTH], ih.SOTransDate, GetDate()) = 2 THEN id.SOExtChargeAmount ELSE 0 END) AS MonthLessTwo, SUM(CASE WHEN DATEDIFF([MONTH], ih.SOTransDate, GetDate()) = 3 THEN id.SOExtChargeAmount ELSE 0 END) AS MonthLessThree, SUM(CASE WHEN DATEDIFF([MONTH], ih.SOTransDate, GetDate()) = 4 THEN id.SOExtChargeAmount ELSE 0 END) AS MonthLessFour, SUM(CASE WHEN DATEDIFF([MONTH], ih.SOTransDate, GetDate()) = 5 THEN id.SOExtChargeAmount ELSE 0 END) AS MonthLessFive, SUM(CASE WHEN DATEDIFF([MONTH], ih.SOTransDate, GetDate()) = 6 THEN id.SOExtChargeAmount ELSE 0 END) AS MonthLessSix, SUM(CASE WHEN DATEDIFF([MONTH], ih.SOTransDate, GetDate()) = 7 THEN id.SOExtChargeAmount ELSE 0 END) AS MonthLessSeven, SUM(CASE WHEN DATEDIFF([MONTH], ih.SOTransDate, GetDate()) = 8 THEN id.SOExtChargeAmount ELSE 0 END) AS MonthLessEight, SUM(CASE WHEN DATEDIFF([MONTH], ih.SOTransDate, GetDate()) = 9 THEN id.SOExtChargeAmount ELSE 0 END) AS MonthLessNine, SUM(CASE WHEN DATEDIFF([MONTH], ih.SOTransDate, GetDate()) = 10 THEN id.SOExtChargeAmount ELSE 0 END) AS MonthLessTen, SUM(CASE WHEN DATEDIFF([MONTH], ih.SOTransDate, GetDate()) = 11 THEN id.SOExtChargeAmount ELSE 0 END) AS MonthLessEleven, SUM(CASE WHEN DATEDIFF([YEAR], ih.SOTransDate, GetDate()) = 0 THEN id.SOExtChargeAmount ELSE 0 END) AS CurrentYearTotal, SUM(CASE WHEN DATEDIFF([YEAR], ih.SOTransDate, GetDate()) = 1 THEN id.SOExtChargeAmount ELSE 0 END) AS LastYearTotal, SUM(CASE WHEN DATEADD([year], - 1, GetDate()) > ih.SOTransDate AND DATEDIFF([YEAR], ih.SOTransDate, GetDate()) = 1 THEN id.SOExtChargeAmount ELSE 0 END) AS LastYearYTD, CASE WHEN a.Account LIKE '400%' THEN 'ALEDO' ELSE ' ' END AS Location, ih.SOTransDate, ih.InvoiceNumber, cm.CustomerName, id.DetailSeqNumber, id.LineType, a.Account, id.SOExtChargeAmount FROM dbo.MAS_CCS_AR1_CustomerMaster cm, dbo.MAS_CCS_ARN_InvHistoryHeader ih, dbo.MAS_CCS_ARO_InvHistoryDetail id, dbo.MAS_CCS_GL_Account a WHERE cm.CustomerNumber = ih.CustomerNumber AND ih.InvoiceNumber = id.InvoiceNumber AND id.SOGLSalesAcct = a.AccountKey GROUP BY cm.CustomerName, Location ORDER BY CurrentYearTotal
In my Report, i have a grouping on project and Drill down on Project Cloumn only,now i need to implement interactive sort on rest of the columns,i implemented But it seems not working. can any one help me ..................... It is urgent requirement for me. rgds, kousik.
I have a 2 row groups in a matrix and I need to add some space between the top one so that all the columns don't run together. Is there a way to do this?
I have a matrix with six rows and the column is dynamic depending on if any data exists for any row item in a month/year. All rows are summations of data for the particular month. I have a row group that when toggled to visible expands all the rows. Is there a way to restrict the row group to only expand the data in a specific row?
I want to show row groups as hierarchy levels and need the sub total values belongs to each group and sub group levels. But the most important point is that my top next top group (from child to parent ) is not static its dynamic.i.e for a diffrent senario my under displayed example can have Universe--->Earth as parent for Australia and USA.
eg:
1.Australia
|-------sydney
|-------Melbourne
2.USA
|------North US
|------North US(1)
|------North US(2)
|------South US
|------South US(1)
|------South US(2)
Can I get some help from anybody for making a dynamic row groups in the matrix.
I have a Matrix that counts records by one group. In a simplified scenario, the group values are 1, 2, and 3. When I created the matrix without a subtotal, all 3 groups are returned. I added the subtotal column, and now only 2 of the groups are returned. The dataset query looks like this: SELECT A
, B FROM Table
Without Subtotal this is returned: A CountOfB 1 3 2 6 3 7
With Subtotal this is returned: A CountOfB Subtotal 1 3 3 2 6 6
The last value is missing. When I remove the subtotal column, the last value does not return. Where did it go? Am I missing a setting?
Thank you so much for reading this. Any help would be appreciated. babs
Hi, I am creating a matrix and adding multiple row groups. The problem is that I am unable to display headers for each of these groups - can anyone help??
I am using matrix to make a report. I have company name in the row group and user name in the details field. When I run the report I only see the company name once and each user of that company is displayed in a separate row. Then next company name and its users... I wanted to know if there is a way to display company name next to the user name? I know it can be done by using "table" but I can't use table because in this report there are other fields can only be done in a matrix. So, please let me know if there are any settings in matrix which I can use to display my company name next to each user of that company. Please ask me any thing if the question is not clear. Thanks a lot for the help.
I am trying to make this report and I am using matrix in it. Currently it merge my outer group value. Is there any ways that I can use Matrix and have my outer group values REPEATED and not merged. Any help will be appreciated.
I'm dealing w/ SSRS 2005. I have my main matrix report which has five row groups.
What I'd like to do is have the subtotal at the 4th level have a coloring for the whole row at run-time....so the user can follow from left to right what the 4th level subtotal actually is (the report can get fairly wide).
At design time, you don't even see the rows to the right of the subtotal, you just see the subtotal box.