SSRS Export to Excel does not do expand/collapse of groupings correctly - sql

My report works and looks perfectly in the web viewer and looks great in PDF export as well. But when I export to Excel the exported file does not do the groupings correctly. The intent is to have a list of all employees and have their list of accounts underneath that is collapsible. However in Excel the entire report is grouped under one header and it collapses the entire report instead of allowing each header to collapse.
This is the proper way / web viewer:
But excel is collapsing the entire report not just each header:

I found the answer in this comment left here where the author mentions the way to do groupings.
http://connect.microsoft.com/SQLServer/feedback/details/508823/reporting-services-2008-group-by-export-to-excel-duplicate-rows-csv-ok-pdf-ok
The easiest way I've found to "fix" this is to re-create your hierarchical groupings (and the rows contained). Starting from the detail row (assuming you still have one) select the row header, right click for the menu, add new parent group using the next hierarchical level up. This creates a fun column that is to the left of your previous content separated by the dashed line. Select the column, right click for menu and choose delete. In the following dialog just remove the row, not the group you just made. This leaves the grouping containing only the details row/group. Select the existing details row header again, right click again, and choose to insert row > Outside Above (or below as your need might be). This adds the row to the next outer grouping from the selected detail row, similar as how 2005 allowed us groupings.

If I remember correctly SSRS 2008 can't deal with 2 level of grouping on the excel export (that was a confirmed bug), but i thought that was fixed either with SSRS 2008 R2 or a CU later on. Are you on the latest available version of SSRS ?

Related

VB.Net & RDLC reports: Display dataset records as fixed fields

I'm developing a rdlc report, that uses the data from a dataset, programmatically filled (from VB.Net). I need to display the data of the dataset as in the linked photo, so not in a classic "table" way, but each page of the report will concerne only one record of the dataset. Any cells of first page will be filled with the data of the first row of the dataset, the second with the second and so on.
Is it possible to display the report in this way with rdlc?
Further to my comment, I believe it's possible to do what you want using the table, with a bit of work on the layout.
Start by adding a table in the normal way, and get that basically working ie so that it shows all the data across one row. Then work on re-arranging the cells so that they are in vertical columns. Do this by right-clicking in the shaded area to the left of the rows, and select 'Insert Row'
Finally create a group around the whole thing, and group by Item Number or w/e is appropriate for your data. Then in the 'Row Groups' window at the bottom of the designer, right click your new group and select 'Group Properties > Page Breaks > Between each instance of a Group.
This should get you pretty close to your required layout.

Crystal Reports crosstable formatting

My colleague and I have taken over a vb.net project that uses Crystal Reports (I have CR9 on my PC).
The user has given the following feedback to us on how he would like the reports changed.
1) At the moment, it is wasting space by showing empty columns. How is it possible to not show the columns where all values are "-"? (I've tried using Crosstab Expert, however there are some reports where the columns have second sub-columns with titles in, so with these ones it shows them as it treats the columns as not empty)
2) The crosstabs at the moment are displaying from left to right, and are adding next to each other. My user wants the tables to go underneath each other, so that the report goes downwards, rather than sideways. How is this possible?
If anybody knows a fix to either of these issues that would be great, thanks.
In regards to the empty columns, you can choose a custom style in the Crosstab Expert and select Suppress Empty Columns
If the dashes don't count as empty, you might need to change the crosstab to evaluate a formula which replaces the dashes as zeroes or blanks.
I'm not aware of a good way to make a crosstab separate vertically as you specified. But you could swap the rows with the columns. It appears to me you have way more columns than you do rows, which should fit better on the page.
I suppose you are using the database field directly in the cross tab which is the reason you are getting -. Possible approach would be to write a condition and use that in cross tab. something like below
Create a formula #Formula1
if {Database.field}<>"-"
then {Database.field} //You can end the condition here if you wish
else "" // If you write else then check option supress empty rows or columns as per requirement
Now create a cross tab using Formula1 and display
Coming to your second problem , If you not wish to spread cross tab horizontally then you can pivote cross tab by Right click on cross tab or go to cross tab expert and give the fields that spread in rows part and that are static in column part.
Hope this helps

SSRS report. I need to total non aggregate data

I'm quite new to ssrs, so please bear with me.
To simplify - I have a sql server table with 3 columns -
ProductGroup, ProductName, ProductWeight.
My query simply selects everything, ordering by productGroup.
In my ssrs report, I need all individual rows displayed. Straightforward enough.
However, I need to insert a total ProductWeight for each ProductGroup. i.e. I need a rows with these totals between each changing of the groduct groups.
I can't simply aggregate the ProductGroups as I need all the individual records displayed.
I hope I'm making sense.
Many thanks.
This is actually very easy to do, but not obvious if you are new to SSRS.
When you are is design mode in the report development tool (assuming you are using Visual Studio (or BIDS)), look for the Row Groups section down at the bottom of the window. You should see a row in that list that has the text (Details) in it. Right click on that row, hover you mouse pointer over Add Group, and then choose Parent Group… from the context menu. Choose the column to group by; ProductGroup in this case. Click OK.
You will see a new column at the front of the tablix for the ProductGroup. Right click on the detail row under the new column, go to Add Total, and then choose After. This will create a new row below the detail row where you can add aggregates for columns where is makes sense. When you hover over this row for the ProductWeight column, you will see a little field chooser button, click that and choose ProductWeight from the dropdown. By default, that adds a Sum aggregate into the new row for that column. You can change the aggregate (to an average, perhaps) by right clicking on the cell, and choosing Expression from the context menu. Preview the report to see if that is what you need.
At this point, you can remove the original Product Group column since it is no longer needed.

SSRS Row Gropings Inverted (Export to Excel)

When i run my report my report in SSRS all groupings work correctly however when i export this report to excel the proper rows are grouped but the grouping is inverted (i.e. the last item in the grouping has the '+' sign instead of the parent, top row)
thanks for any help in this matter!
In SSRS, when exporting to Excel, if the report item that controls whether another item is toggled is not in the previous or next row or column of the item being toggled, the outline is disabled also. See:
https://msdn.microsoft.com/en-us/dd255234.aspx
This can happen if you have your total added after the group rather than before.
(right click on the group and click add total before)
However, we really need more details/screenshots to see what the cause might be.
The drilldown in SSRS has more features than the grouping in Excel can handle so sometimes it is not possible to get in excel what you have in your report..

How to update the Dataset to reflect an added column in the data source without deleting the adapter?

I've made a dataset using the dataset designer, and I'm trying to add a column to reflect changes made to the database (added a column, nothing fancy). Is there a way to 'refresh' the dataset schema from the datasource without deleting my adapter (and all the methods and queries I've created)?
I know its been a while since you posted but as I was having the same problem and figured out how to do this I reckoned I'll post the solution that worked for me.
Right click on the dataset object you want to update (on the strip at the bottom of your viewpane)
Select "Edit in Dataset Designer"
in the dataset designer, right click on the header of the table you want to add a column to
select configure... this will bring up the sql statement that is used to draw values into the dataset for this table
Edit the sql to include the column you want to include in your dataset's table and click finish i.e. in the select statement, include your columns name in the list
close the dataset designer then go to any controls (in my case its a datagridview), click on the tasks arrow (top right hand corner next to the handle) and select add column
select the newly created column from the list of databound columns and click "add"
select "edit columns" from the task menu
move the column to the correct position (it will always be placed as the last column in your grid and you may not want it to be the last column)
voila, I know its hardly snappy but it beats the hell out of deleting the dataset and then fixing up all the coding errors that come up... also after doing it a few times it'll be like second nature (I hope)
regards
p.s. am working in VS2010
Had to just delete the adapter and the table. It's rather annoying but I guess there really isn't a way around it. Maybe in VS2010 or later versions of .net.