I am using Microsoft Reporting Services (rdlc, that comes with Visual Studio 2010)
Suppose I want to create a report that has a Group Header, detail rows, and a group footer.
(I'm using Tablix, but if there is a different way, I'm open to it).
Now, there are several columns, but I want for the group header to span the columns. Is that possible?
Another question:
Suppose I want to conditionally span columns in my detail row, is that possible? (and how?)
Say you have teams/reps and you want to send them their leads/appointments to work on for the day.
A lot of tutorials for grouping in a RDLC Tablix look like this:
But you want it to look like this:
Step by step, here’s how I’ve figured out
Add your table (Tablix) and ensure the DataSetName property is set
Highlight the details row and right click. Add a parent group to the row
Set the group by to e.g. TeamDescription, and check Add group header
The Row Groups panel should look like this. The indent for the Details is needed.
OK, at this point you’ve got what you don’t really want. ANDY and BELINDA are going to appear in a column to the left of your info.
But that’s fixable. In the spare cell above e.g. ApptStart enter e.g. [TeamDescription] and right click on it and choose to merge the cell across the other three columns. Set its alignment to center. Maybe bold too.
Then delete the first column as that’s now redundant.
Here’s how it should look by now:
You can get a field to span columns by selecting a few of the header fields and selecting the "Merge Cells" option.
As for conditionally spanning, you can't do that directly but I can think of a workaround. It really depends on the data you have so for a better answer you need to provide more information.
You could have two detail rows and conditionally hide one or the other. In one row the cells could be merged and not in the other. The only thing you couldn't necessarily control with this technique is the order of the rows, but it might work.
Related
I've got a report with parent and child groups as you can see below, which work fine.
Results look like this and as you can see column from Initiative Name to Reasons for Overall status are the same, therefore I would like to group these as well, but I can't figure it out. When I add a new child group (Milestone Name), it adds column right after the Initiative name column, which I don't want to.
The ideal results should look like this:
Could you advise me how can I achieve that, please? I've also tried to use subreport, but I wasn't able to make it work either.
Many thanks!
You should be able to add the columns to the grouping in your outer group (MissionCritical).
Once this is done you will probably (this is from memory) need to insert a row under the top row (Right-click, insert row, inside-group, below).
This will give you two rows for the outer group.
Then copy / paste the contents of each column affected (the light blue ones I guess) and paste them into the new row. You can then remove them from the details row.
This should give you what you want. If not, let me know and I'll setup a sample to demonstrate.
Sample Report showing where header should span
I hope the attached image explains succinctly what I am asking. I have a Matrix with a parent row group, a child row group, and a column group. I need to have a title for each group that spans a column group. The title will be the value of the Parent Row Group. Obviously by it's nature, a column group may be one or more columns which makes this very tricky (I hope not impossible though).
Does anyone know if this can be achieved, and if so how?
Thanks in advance!
I don't 'think' this is possible due to the presence of a column group. The only way I can think of to achieve this would be to create a subreport that displays single parent group (almost identical to what you have now), with a textbox on top of the tablix containing the parent group text.
The main report would then be a single cell table bound to a dataset that just lists the parent groups. In that cell you would place you subreport.
You can just create a parent table and put your table in it. The parent table will expand with the child.
Create another table with one column.
Set the dataset to be the same as your current table.
Add grouping and group on 1.
Make the group text box the same size as your table.
Drop your table in the group text box.
Add you header.
I don't have enough reputation to comment or to upvote Hannover Fist's answer, but it is a good way to proceed. You can indeed nest tables. You just need to make sure that the cell of the outer table that you paste the expanding table into does not have any row or column groups around it: you normally get a Detail row group when you simply insert a table, and you'll need to delete that group.
Subreports work too, but it's messy to have to break a long report into many subreports just because you want spanning headers.
I am trying to create a Table that shall contain some columns with basic facts on the left and on the right side there shall be some columns that can be tabbed. Something like this:
So the Question is, how to do this?
I could personaly think of two solutions, but I actually don't like both:
Write a own Table for Tab1,Tab2 ... That contains the basic data and the Tabbed Data
Write a Table for the basic Data and one for each Tab. Here I think you would have a lot of Design problem "glueing" both tables together, so they look like one table.
So actually I don't like both solutions. Maybe there is a better solution to this?
Perhaps you could give the columns that belong to each tab their own unique class, e.g. .tab1-columns, .tab2-columns, etc. Then, you could show or hide the column depending on the active tab. The tabs, however, would exist outside of the table. Alternatively, you could pt the tabs into a pseudo- header row above the actual table header row, with the first header cell spanning those cells that shouldn't be "tabbed". However, I believe leaving the tabs outside of the table would be a bit more semantic in nature.
HTH.
Render all columns but hide them (display: none;) except the column by default.
Then add an click event on the tabs to switch the visible columns. be sure to use just the nav-tabs and not the js component.. it will be easier I think
Is it possible to display dynamic number of tablix(es) in a report?
That is, if we do not know the number of tables/tablixes to be displayed in advance.
The requirement is that all the output tables will have exact same structure (row and column lables, groupings, etc.).
If you are using data from a single data source, you could achieve this result by using a single tablix, having the highest grouping on the item(s) you want to use to break up the tablix and including a page break as part of that grouping.
For now, I found a way to solve it. Created a static row within the top group and set set its RepeatOnNewPaAge=true. Remove the borders, so that it looks like a separate text above the table.
This way, it prints the latest group info at the top (because it is part of the group) and also gets displayed on every page, because it is statc. Cool huh? :-)
My SSRS report is using groups to divide the data in group. I would like to have a line separator at the last row of the group. I did hide the group footer and header since it gives me an extra row when render the report to excel, So the bordering of group header or footer for this is not working. I wanted to avoid the extra rows in excel. Is there any other way I can try to get this done?
Probably the most powerful thing about Reporting Services is the ability to use expressions for any object property. Couple this with the out-of-the-box Previous function which allows you to access the previous value of a field and you have a solution.
Select the entire Detail row. Expand the BorderStyle property and enter the following code for the Top property (assuming we want a line separating all the departments):
=IIF(Previous(Fields!Department.Value) <> Fields!Department.Value, "Solid", "None")
This compares the previous value of the Department field with the current value and if they are different, it makes the Top border of this detail row to be Solid.
While this puts a line at the top row of next group rather than the bottom row of the previous group, it is visually and functionally equivalent to what you are after with the benefit of being really easy to implement.