Link to home
Start Free TrialLog in
Avatar of Lisa Callahan
Lisa CallahanFlag for United States of America

asked on

SSRS Column Groups

Hello experts -

I don't know if what I want to do can be done, so I figured this is the place to find out.

Is it possible to remove the blank fields when creating column groups in SSRS? Please see the attached Excel file for an example. What I want is for all the data to be at the top of the column headers instead of each group starting when the previous group ends. For example, the data in cells C43 to C131 would actually start in cell C3 instead of C43.

Thank you.

-- Lisa
Dwell-Report.xls
Avatar of Russell Fox
Russell Fox
Flag of United States of America image

Can we see the query, or a modified/simplified version of it if it's sensitive data? What does the top row represent (0, 1, 2, 4, 6, 8...)? It looks like it's sorting/grouping based on something that ought to be in column A: if you can give each "t Unit ID" column a row_number and group by that, you should get all of them at the top in whatever order you need. For example, run this and you'll get an approximation of your data with an included [tUnitRank] field which will go into Column A as the GroupBy and SortOrder:
DECLARE @tUnits TABLE(ColumnHeader INT, tUnitID VARCHAR(25))
INSERT INTO @tUnits
		( ColumnHeader, tUnitID )
VALUES	(0,'KCS 802751')
,(0,'KCSM010275')
,(0,'KCSM022145')
,(0,'KCSM022165')
,(0,'KCSM022259')
,(0,'KCSM061007')
,(0,'KCSM061010')
,(0,'KCSM061096')
,(0,'KCSM061227')
,(0,'KCSM061440')
,(0,'KCSM061442')
,(0,'KCSM061525')
,(0,'KCSM246111')
,(0,'TFM 050206')
,(0,'TFM 050216')
,(0,'TFM 050244')
,(0,'TFM 050247')
,(0,'GONX330050')
,(0,'GONX330159')
,(0,'GONX340049')
,(0,'GONX340274')
,(0,'TFM 055013')
,(0,'TFM 055031')
,(0,'TFM 055114')
,(0,'TFM 055635')
,(0,'TFM 055956')
,(0,'TFM 055968')
,(0,'TFM 060208')
,(0,'TFM 060500')
,(0,'TFM 060591')
,(0,'TFM 060598')
,(0,'TFM 060605')
,(0,'TFM 060646')
,(0,'TFM 060654')
,(0,'TFM 060678')
,(0,'TFM 060748')
,(0,'TFM 060864')
,(0,'TFM 060911')
,(0,'TR  526861')
,(0,'TR  585558')
,(1,'TFM 060878')
,(1,'TFM 060687')
,(1,'TFM 060533')
,(1,'TFM 060419')
,(1,'TFM 060069')
,(1,'TFM 060190')
,(1,'TFM 055159')
,(1,'TFM 055220')
,(1,'TFM 055238')
,(1,'TFM 055024')
,(1,'KCSM061400')
,(1,'GWWR003045')
,(1,'KCS 800864')
,(1,'KCS 802735')
,(1,'TFM 055001')
,(1,'TFM 055011')
,(1,'KCSM061486')
,(1,'GONX320414')
,(1,'GONX340031')
,(1,'KCS 800198')
,(1,'KCS 801011')
,(1,'KCSM061539')
,(1,'KCSM061553')
,(1,'KCSM061561')
,(1,'KCSM061595')
,(1,'TFM 050063')
,(1,'TFM 055071')
,(1,'TFM 055155')
,(1,'TFM 055161')
,(1,'TFM 055222')
,(1,'TFM 056172')
,(1,'TFM 056194')
,(1,'TFM 060017')
,(1,'TFM 060477')
,(1,'TFM 060513')
,(1,'TFM 060611')
,(1,'TFM 060644')
,(1,'TR  585528')
,(1,'KCS 801071')
,(1,'KCSM001292')
,(1,'KCSM022035')
,(1,'KCSM022050')
,(1,'KCSM022111')
,(1,'KCSM061223')
,(1,'KCSM061234')
,(1,'KCSM061422')
,(1,'KCSM061487')
,(1,'KCSM061552')
,(1,'TFM 050051')
,(1,'TFM 050067')
,(1,'TFM 050070')
,(1,'TFM 050083')
,(1,'TFM 050085')
,(1,'TFM 050118')
,(1,'TFM 050223')
,(1,'TFM 050246')
,(1,'TFM 050254')
,(1,'TFM 050273')
,(1,'TFM 050504')
,(1,'TFM 055014')
,(1,'TFM 055129')
,(1,'TFM 055150')
,(1,'TFM 055204')
,(1,'TFM 055346')
,(1,'TFM 055487')
,(1,'TFM 055590')
,(1,'TFM 055949')
,(1,'TFM 055981')
,(1,'TFM 055993')
,(1,'TFM 056033')
,(1,'TFM 056075')
,(1,'TFM 056248')
,(1,'TFM 056402')
,(1,'TFM 056465')
,(1,'TFM 056494')
,(1,'TFM 060200')
,(1,'TFM 060282')
,(1,'TFM 060532')
,(1,'TFM 060708')
,(1,'TFM 060755')
,(1,'TFM 060900')
,(1,'TR  526123')
,(1,'TR  526629')
,(1,'TR  585542')
,(1,'TR  585624')
,(1,'TR  585649')
,(1,'GONX310532')
,(1,'GONX310570')
,(1,'GONX310845')
,(2,'KCSM061481')
,(4,'KCSM032177')
,(4,'TFM 060927')
,(4,'TR  585642')
,(4,'KCSM061416')
,(4,'KCSM061420')
,(4,'KCSM061556')
,(4,'TFM 050137')
,(4,'TFM 050146')
,(4,'TFM 055525')
,(4,'TFM 060751')
,(4,'TFM 060827')

SELECT *
	, tUnitRank = ROW_NUMBER() OVER(PARTITION BY ColumnHeader ORDER BY tUnitID)
FROM @tUnits
ORDER BY ColumnHeader, tUnitRank

Open in new window

Avatar of Lisa Callahan

ASKER

I have attached the report with a tab for the data. The first tab shows what SSRS does by default, each group below the group before it. The second tab is the original report I posted, with the blank spaces if you put the groups as column groups instead of row groups. The last tab is the source data. There is a rowgroup that just puts the groups in rank order, but when I changed the column group to use that instead I still got the blanks when exporting to Excel.

Thank you.
Dwell-Report-with-Data.xls
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.