Hiding a row if text box is hidden - reporting-services

I have a report that lists parts required for a job, and then within each part it has rows that show locations and quantities of parts on-hand. The main list has a header (part number, description, quantity) which is only shown once at the top because it is not within the grouping. However, the second header (on-hand quantity, location) is within the grouping so it repeats. I would like it to only show once.
I have tried using the hide duplicates property for the header text boxes, but this still leaves blank rows. I have also tried setting the row visibility using a comparison between ReportItem!lblOnHand.Value and Previous(ReportItem!lblOnHand.Value) but this gives me an aggregate error.
This is what the report is displaying now:

You need to set the row visibility rather than the individual text boxes. Right-click the row header to access the setting..
You should (untested) be able to use the same logic as you have now. If this does not work then you will need to test if the group is the first group and use that in the expression, something like...
=Fields!Partnumber.Value <> FIRST(Fields!Partnumber.Value, "myGroupOrDatasetNameHere")
The above would hide thew row if the part number in the current context is not the same as the first part number in the group or dataset name specified.

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.

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.

Combining Cells in Locally Rendered Microsoft Report

I have a basic Tablix in my report that currently renders as follows:
These are steps in a manufacturing process with the clock number of the person who performed them with date performed in the last two columns. However, sometimes steps are combined and performed together. In the example above, steps 10-20 are performed together, and 30-40 are performed together. So I would really like the report to be rendered like this:
I do have a column in my data called "StepRange" which in the above example would be "10-20" for the first two rows and "30-40" for the third and fourth rows. So when the value of StepRange is alike, I know those rows are performed together and henceforth the last two columns should be combined. My example shows only two rows being combined at a time, but it could be any number.
How can I make my report look like the second example above instead of the first?
Single Tablix Method
Rather than literal conditional merging, you can set the border style of a textbox using an expression to achieve a similar effect. There are a few steps, but none of them are particularly involved.
Create a parent group for StepRange. Do not add a header or footer, and delete the added column without removing the group.
Make sure that your properties panel is visible on the right of your screen. If not, check the "Properties" checkbox under the View ribbon.
Click on your first detail TextBox and expand the "BorderStyle" property. Set the "Top" property to the following expression:
=IIF(RunningValue(Field!Step.Value,CountDistinct,"StepRange")>1, "None", "Solid")
Set the Bottom property to "None".
Set the expression of the detail TextBox itself.
Replace FIELDNAME with the appropriate field:
=IIF(RunningValue(Field!Step.Value,CountDistinct,"StepRange")>1, "", Field!FIELDNAME.Value)
Repeat this process for each detail TextBox.
You may need to create a dummy row at the bottom with a black top border if you do not have a summation row. (optional)
The expression only evaluates to "Solid" for the first Step value within each StepRange group, so subsequent rows do not have a top border and appear undivided.
Nested Tablix Method
Using a nested Tablix is more straightforward. I have had some issues with them, including some rendering hiccups. But in a report this simple that may not be an issue at all.
Set up your main Tablix to group on StepRange.
Either clear or add a column to the left for the individual steps.
Select "Insert Table" from the toolbar and click on the empty cell.
Set the cells to your step and operation fields and delete the extra column.
The result should look roughly like this:
By default the inner Tablix will be detail grouped. If your detail rows are more granular than the "Step" field, go to the properties of the "(Detail)" group and add a Group Expression for Step.
You can also delete the inner header row if you don't want to see it repeated in the report.
This results in the employee fields actually being merged and spacing properly. If you don't use an aggregate function on those fields, their value will be that of the first row returned internally. Which is moot if their values are uniform across steps.

Page Break on Change of Column Value

I have a simple customer history report that has the following elements:
Header that contains the customer name and customer ID pulled from 1 of 2 datasets
Rectangle that contains a list which provides some details order items like date ordered date shipped invoice number and such.
Sub report placed within the list area that contains table with order details.
This report functions fine if I call one customer at a time. I need to print multiple customers at a time so I have multiple values for my parameter. When I try to call more then one customer I get the following results:
The header prints with the first customer data and shows it on all pages. The list renders as designed but pulls all customers data so it appears there is just one customer.
What I need is a page break for each customer. When I new page starts I need the customer name to be shown on all of the pages that group will print. Placing the name at the top of the first page only does not work for my situation. I have tried placing pages breaks after the list. I have placed page breaks after the containing rectangle and I have created another rectangle and nested the original rectangle within this new parent with a page break on the new parent but none of these will work. I have also tried placing the customer info in the header but all I get is the information from the first record in the dataset.
This seems like a simple report but I just cannot seem to get the page break to fire when the customer ID changes.
In the properties of your List object, go to PageBreak, and set BreakLocation to "End".
Make sure Disabled is set to "False".
I was able to solve my problem by using the information at these 2 sites
Solved the problem of getting the page to break after the list
This allowed me to have a page break for each customer. It placed another row in the tablix that contained the group on field, which in my case was the name. I had to make a modification to hide this new row so I changed it's width to a very small space and set it property to hidden. I then placed a text box above my list to show the name there.
Solved name at top of every page in the group

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.