SSRS 2005 - How to tell when Group has changed - reporting-services

Is there a way to determine when a Grouping has changed in SSRS 2005?
For example, if you are grouping on OrderID, displaying the Order Header info, and the details are the Order_Items etc... Is there an event to check for to tell when the "new" OrderID has appeared?
Are you able to somehow compare the current OrderID to the previous OrderID in the group?
I have multiple groupings in a report, and this group in particular is the 3rd group, and on the Grouping change, I want to make the border of the Group Header solid. There are certain occasions depending how the groups change, the boarder is left as "None" and it looks odd in the report.
Edit: (Here is an Image Example)
I have managed it so far by adding an additional row to another grouping, and making the row height .03125. It gives off the desired appearance, but I thought there was a way to tell when the grouping changed. Maybe grouping row number = 0 or something?

Theres not really an event, but you should know that when you create a group you can include a group footer within the group. The groups details ends once it hits the footer of the group.
I personally like to use this to create row border style (bottom) with a line to get a nice effect allowing me to see when the group is complete.
Something to this effect:

Related

SSRS Report Page Break Logic for Groups in a single report

I have created an SSRS table element where we have multiple grouped items like below generated in a Portrait mode.
Problem:
Whenever there are many items in a single group, some items in the group get spilled over to the next page. That is, a page break is applied.
Example,
If there are 3 groups in a table, and 2nd group contains 50 items, 30 are displayed on the first page, page breaks and then the remaining 20 are displayed on the second page and so on until all the remaining groups are displayed. This is a normal scenario which happens by default.
Expected Solution:
What is expected is, if the data region of any of the group spills over to the next page, then the whole group along with the group header needs to be shifted to the next page. The idea is to have the whole data region of the group stay together.
This is like a smart table (group split).
This is dynamic in nature in the sense, where if for a group with less rows, it fits and stays together on a single page, then page break doesn't happen.
I tried multiple options like below but none of them worked.
- Change the Keep Together flag of the Grouped rows and the Data Region to True.
- Add a page break after each row group using the Group properties.
Can someone please let me know if there is at all a way to achieve the smart page break like the one expected above?
You can't do that but there are two ways that you can do.
You can remove paging of SSRS report. to remove Paging by opening property window of report and set InteractiveSize's Height value to 0. it will remove paging of the report
You can repeat your Group header if there to another page as well so that user have idea about this data belongs to which group.

SSRS make parent group heading show for all child groups

I have an SSRS report with the following row groupings:
[Grandparent]
[Parent]
[Details]
Currently when the [Parent] group changes value, the [Grandparent] row will disappear in the report unless it's in a new [Grandparent] group. I would like for the [Grandparent] row to always show even when it's the same [Grandparent] but different [Parent]. Is there a way to do this in SSRS?
Why not add another row above [Parent] group but inside the Parent group and get it to display the Grandparent. If the rows repeat themselves when the group changes.. get around it by having a row visibility on the bottom one to check if the values are the same and hide it. something like
=iif(Previous(Fields!firstgrandparentvalue.Value)= Fields!secondgrandparentvalue.Value, true,false)

Displaying page number in body of RDLC

How do I get Page Number in Body Section of RDLC report. Globals!PageNumber can be used only inside either Report Header or Footer. What if I put Row number to my dataset and get the record number.
Limiting the number of records per page and do the visibility calculation based on the records number is the best solution so far that I've heard of.
Can anyone educate me on this logic?
Or is there any other workaround for this?
P.S:
Other so-called solution like using Custom code is not giving you the correct page number. It will always show 1.
There isn't really an easier way to get the page number in the body. I think working with the dataset row count is the only reliable way.
What I have here is a short SQL statement to get Project Status information:
SELECT * FROM PROJ_STATUS
So I'll add the row number as a field, and also divide it by the number of records I want per page and add 1 (giving me the page number of each row)
SELECT * , ((DENSE_RANK() OVER(ORDER BY PRS_ID) -1) / 3 ) +1 AS [CountRow] FROM PROJ_STATUS
Now in my report I've got a table showing the status names and if they are active or not... I'll also add the page number as a column.
Next put a list in the report and put the table inside it.
Then click the top left square corner on the list and in the properties window set the dataset to the one you are using.
Then right click on the row group in the list and set the grouping to the page number column.
And put page breaks in between instances.
And there you go!
Reason why the -1 for #4Star. See that without the -1 the 3rd row is on the second page.
If your dataset is a row per whatever you want to get page numbers for, then
=RowNumber("DataSet1")
will work.
This is the same as using
row_number() over (order by (select null))
as it gives you an arbitrary ordering for row numbers.

Reporting Services - List of lists

I have a report which displays the area, a list of diagnoses for the area, how many diagnoses for each diagnosis, and a percentage. This works fine, however I want to choose and display the data for many areas.
Currently, I have one choice for the area, and it shows all the diagnoses for the chosen area in a table. Essentially, I want to make a list of this tables, so it can be repeated for as many areas as required.
I think that this can be performed by putting the table in a listbox, and setting the tablix to filter for each area, but if I try this, I get:
Error 1 [rsInvalidDetailDataGrouping] The tablix ‘Tablix1’ has a detail member
with inner members. Detail members can only contain static inner members.
It's hard to explain exactly what I need. At the moment, all the diagnoses are displayed, but they are all listed as being from the same area. I need a list of diagnoses from area 1, then a list from area 2, then area 3 etc. The percentages need to be the percentage from that area, currently they are the percentage of all areas.
What is the best way to do this?
Don't put the table in a list - just use grouping on the table.
Let's say you now want a multiple vaue parameter called #Areas to choose the areas and then print them all out, say separated by a page break. I assume you have something like a table for Diagnoses and a table DiagnosisItems for the items performed in a diagnosis. So your SQL looks something like this:
SELECT Diagnoses.Area, Diagnoses.DiagnosisDate, Diagnoses.Description,
COUNT(*) AS TotalDiagnoses
FROM Diagnoses
INNER JOIN DiagnosisItems ON Diagnoses.DiagnosisId = DiagnosisItems.DiagnosisId
WHERE Diagnoses.Area IN #Areas
GROUP BY Diagnoses.Area, Diagnoses.DiagnosisDate, Diagnoses.Description
ORDER BY Diagnoses.Area, Diagnoses.DiagnosisDate, Diagnoses.Description
Click on your table then right-click the grey handle that appears on the left hand side in the Detail row. Choose Add Group and group by Area. Add a group header and a group footer. In the table, put the Area in the group header and in the group footer put Area and the total diagnoses for that area:
=SUM(Fields!TotalDiagnoses.Value)
Now on your Detail row for the percentage you'll use an expression like this:
=Fields!TotalDiagnoses.Value / SUM(Fields!TotalDiagnoses.Value, "table1_Group1")
Right-click on the group handle, select Row Group-Group Properties-Page Breaks and check page breaks between each instance of a group.
I don't think you need to put a filter on the tablix. Just set the grouping on the list and add the tablix.

group devider in reporting service report

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.