SSRS pagination options (KeepTogether, KeepWithGroup) not affecting printable output formats (PDF) - sql-server

I have an SSRS report with a pretty simple overall structure, and I am trying to use the KeepTogether, KeepWithGroup, and RepeatOnNewPage properties of tablix members to control how groupings display on multiple pages.
Everything works beautifully in the web mode of the report, but printable formats like PDF and Word completely ignore these settings. They instead to appear to treat the report as one giant long page, and then insert their own pagination wherever they need to.
Here is what the tablix looks like:
And here are the row groupings (in advanced mode), with annotations for the properties I have set for them:
This is all on SQL Server 2012 SP 1 CU 16 (recognizing that there was presumably a bugfix for KeepTogether in CU1). What's the deal here?

You need to review your Column Groups as well I think (the logic is backwards I feel). Looks like you found the Advanced section in the grouping pane. The rows are on the left and columns on the right - try setting the keep together properties for the static column grouping items as well.

Related

SSRS - Can Individual Columns in a Grouped Row be Hidden Without Hiding the Entire Row?

I am using SSRS 2014, aka Report Builder 3, to develop reports at work. The one I'm currently working on requires a "user-level view" and a "supervisor-level view". The difference between the views is that non-supervisory users don't need to see the first three columns and should only see data related to themselves, not other users. Supervisors do need to see everything, but also want to be able to limit what's on-screen at any given time.
I can read the user's role and set visibility based on that. The problem is that I can't hide the columns because the option is not available for them. The option IS available for the columns I'm not grouping on, so I assume that this is because the rows are being grouped on those first three columns. Is there a way around this?
As far as I know there is no nice way of doing this. You can actually hide columns that are not on the details rowgroup even though the right-click context menu does not show the option.
If you left click on the column head to select the entire row, then use the properties panel you can set the Hidden property to an expression.
In fact, what you are actually doing is setting all the textbox's hidden properties.
Unfortunately this literally just hides the textboxes so it just leaves a blank area. This might not be too bad if its at the start or end column but if it was in the middle there would be a gap.
In my sample report with the column not hidden
and then with it hidden
Sometimes you just have to rethink how you present the data. In my example, for instance, I could move the data I want to hide (Year) to the next column across but still in the same row group, then delete the first column. Like this...
Now when I run the report with everything visible it looks like this.
Now, I set the ROW visibility of the row with the [Year] field and when I run the report I get this...

SQL Server Report Builder for Shipping Labels, One per page

I am trying to replace our outdated shipping label program with a SQL Server report, and I am very green when it comes to doing this. I am testing using an ODBC connection with some sample data. I have created a DataSource which is a simple "SELECT * FROM LABELLIST" statement. Each row in this table contains ONE label.
In the DataSet I have each column that is needed (To, From, Carrier, PO, etc) listed. I have dragged the fields onto a blank report and in the expression it is set to "=Fields!FROMADDRESS.Value". As mentioned earlier, each ROW is a new label, but when previewing, I only get the first record as a label. What do I have to use (tablix, matrix, list, grouping?) to accomplish this and how?. I'm not sure how to search for this answer online and was hoping to get a reference page to read on how to do it. Everything I've found pertaining to labels or "row to page mapping" is showing how to print multiple labels/rows to one page and not each row to a single page.
EdIt: to clarify, each label is being sent to a zebra thermal printer and follows a similar format to a UPS or FedEx shipping label. Each row in the table will be one shipping label.
The key for you to understand is how SSRS handles Page Breaks. I have a similar answer here.
Whatever formatting you have for your labels should be placed inside a Rectangle.
Place this rectangle into a table with one cell that is grouped by label ID.
Set the group to page break between instances.
This makes the report repeat one instance of the label on each page. It can be a little tricky to understand at first, but it is a very useful trick. I have used this for reports like invoices where we needed one on each page.

BIRT Dynamic Columns

What I am currently looking to do is use our existing UI to select a number of columns from various tables (yes, multiple tables) and pass them into a BIRT report as parameters. From there, I am planning on building a query that will dynamically replace the columns into the query and pull the results automatically. I'll have to hide columns with no value passed to them as well. I also expect I'll have to setup the query to be a little heavy handed and already know all of the logical connections in the database (e.g. connect the proper tables, etc).
My question is this the best way to manage a dynamic column/table in a dataset? or is there a better way to manage this method? I'v seen some online information about the "ad-hoc" BIRT report designer that lets non-programmers create reports, but I am not looking for other people to actually build the report, just generate one using an existing template with interchangeable columns.
I think the easiest way is to firstly build a report with all columns that you need.
Then apply some logic on the visibility of the column. You can use the parameters there as well.
Select your table, select a column, open the properties window and take a look at the visibility tab there. Just add some logic that results in a true or false.
If you are using a crosstab to display the information, you could use the filter options to include or exclude columns.
Yes, this will load data that is not used, but you need to build realy big reports for performance becomming a real issue.
If you try to add this logic in the actual dataset, you have to make the query and fetch script dynamic and then you still have the problem with the visualisation of the columns. I think you'll end up using the visibility script anyway (to show/hide the colums on the report), so might just start from there and have a working report fast.

SSRS Excel Export adds total rows for groups, not other formats

I have a report with 3 groups. Each group is a child of the one before it. The two child groups are hidden by default and have their visibility toggled by clicking its parent. Columns to the right contain aggregate values for each of the groups.
My problem is when i try to export the report to Excel there is a row added for each parent group. Viewing on the web or exporting to PDF don't have this problem.
Anyone have an idea for how to prevent this row from displaying?
This is how it looks on the web or PDF (how I want it to look):
This is how it looks when exported to Excel (do not want):
This seems to be a bug that was (allegedly) fixed by Microsoft back in 2010 (I know - it sounds unbelievable). https://support.microsoft.com/en-us/kb/2462084
But according to this Microsoft Answer, it's a known "feature"
https://social.msdn.microsoft.com/Forums/en-US/8b927902-f3d8-46b9-acd0-fd22843b980f/
"When exporting to Microsoft EXCEL, excel will add an extra row for each group"
I found one solution that shouldn't work but might (I haven't tested it):
Insert Column -> Outside Group - Left of your Level 2 Group
go to the newly created Static members (Column Groups/Advanced Mode), and set the Hidden Property to True
https://social.technet.microsoft.com/Forums/sqlserver/en-US/1f221636-cd84-4d89-a226-fba6a4d660d1/

Dynamic selection of dataset in SSRS

I am going to design a report using SSRS 2005. Is it possible to have the selection of dataset done dynamically?
Let's say I am going to have two tables, where the first one is the summary and the second is the detail data. One of my parameters (with values Summary and Detail) will determine which version of the report is to be displayed. Can I have two different datasets, and while clicking the view report button in parameter view dialog (or before) set which dataset which will be used?
You can use the single data set by using switch statement some thing like this:
You can type this in data tab but the results can be seen only in preview tab, but not the data tab like regular queries.
=Switch(Parameters!ToDecide.Value = "Summary",
"Your query for Summary",
Parameters!ToDecide.Value = "Detail",
"Your query for Detail")
Make sure you don't have any excess spaces with in the query(not more than one space where needed)
Both the queries should return the values required by the Table in Layout.
You'll probably have to have 2 pairs of table contained in, say, a rectangle, and hide the unused one (at the container level). Or use subreports.
If you find a way to switch datasets, then you'll have to make sure that all columns are the same as well as making sure that any functions using the DataSet as a scope parameter are changed too... which makes me think it just isn't supported.
You might want to try using a single dataset and having a summary and detail data region (table, list, etc.) in the report, one of which is visible and one of which is not. In this scenario, the dataset is only evaluated once and you are still meet your requirement.
Hope this helps,
Bill
It would be easier to create and maintain if you have two separate tables and hide one or the other depending on the choice made.
I haven't tried this, but I think another possibility would be to use three reports: a container, a summary subreport, and a detail subreport. Switch between the subreports according to the choice.
There is a performance gotcha to the first implementation though. SSRS will try to fill every DataSet in the report when it loads, even ones that are not used in the report's output or by other DataSets or expressions. In other words, just because you're displaying the summary report, doesn't mean that you're not asking the database to fill out your detail data as well.
There is a workaround that can improve the performance a bit, but will still end up with a trip to the server. The hack is to set a flag parameter to determine whether or not the query should actually return any real results or if it should just return the columns you want.
You may try adding condition that depends on a cetain parameter to execute. Then from there, You may use different data set. Assuming that you'll use it on separate hidden tablix.

Resources