Number SSRS pages based on grouping - reporting-services

I have a SSRS report which needs to have paging like (1 of 2, 1 of 3)
currently using
=Globals!PageNumber & "of " & Globals!TotalPages
gives me (1 of 5) which i know is the correct behaviour
Everywhere i see the solution is Group Properties > Page Breaks > ResetPageNumber
I dont get that option though, the pagebreak options i get are
Between each instance
Also at the start of a group
Also at the end of a group

For the ResetPageNumber property, you need to change the property of the Group in the Advanced Mode. In the Grouping Pane at the bottom of VS, click on the down wedge/caret/arrow to change to Advanded Mode.
Select the table, then, in the Grouping Pane at the bottom of VS, select the Group that you want the Reset on. The Group properties will show in the properties window with the PageBreak options that include the ResetPageNumber property.

To achieve what i wanted to do i edited the code itself not the rdl design which i had previously wanted to do
<PageBreak>
<BreakLocation>Between<BreakLocation>
<ResetPageNumber>True<ResetPageNumber>
<PageBreak>
This allowed me to print the letter's which contained a table of information at the end which was X rows long
So report could be (1 0f 1), (1 of 2, 2 of 2), (1 0f X, X 0f X)

Related

SSRS chart, how to prevent horizontal axis categories displaying when value is 0

I've placed a simple bar chart into an SSRS report which is designed to display a series of Consultant Names (along the x axis), with a corresponding count of patients who are flagged as being in the category ">18 Weeks" (on the y axis), based on the following expression:
=SUM(IIF(Fields!RTTWaitGroup.Value=">18 Weeks",1,0))
The chart renders fine. However, a number of the Consultants listed in the chart have a zero count, and therefore are listed across the x axis but with no vertical bar displayed, as you'd expect.
I'd like to configure the chart so that it only displays those consultants that have a count of 1 or more patients.
I'm not overly familiar with the syntax, but I've tried using the following expression in both the Series Properties and Chart Properties 'Visibility' options, to try and suppress x axis categories that are zero, but it doesn't have any effect on the chart:
=iif(Fields!LastConsultant.Value ="",True,False)
Please can anyone advise on correct syntax and appropriate expression field to enter it?
Presumably your consultant names will be in the category group, if so right mouse click and select category group properties.Select Filters, in the expression enter count(fields!patients.value)... for example. Change type to integer , operator to greater than and the value to 0.

SSRS report total fields

How to show the total of each page in SSRS report. What I exactly mean is if pageNumber = 1 total should be sum of amount on page 1, if pageNumber = 2 total should be sum of amount of page 2 + total from page 1, etc...
.Have you tried using the running value function?
See https://msdn.microsoft.com/en-us/library/ms159136.aspx
You can also use ReportItems![CellName] to enable you to display the value in the report footer if required.
If this does not give what you require and you have a fixed page size eg A4 you can calculate the page totals and Page Numbers as a fields in your data set. This is more powerfull in settings where for example you want to print a set of customer statements in a single print run. Each customer statement would need its own page numbers and totals. Again you can use ReportItems to display these values in the relevant part of the report as they would appear at the detail level of the dataset. In this case you add a hidden field(s) containing the values you require on the detail line and pick them up using ReportItems. You can also force a page break at the end of each Page number group
To repeat the report Header / Footer on each page see this link
http://bhushan.extreme-advice.com/repeat-table-header-on-each-page-in-ssrs/.
To start with go to the footer properties and make sure repeat on first and last page is checked.

SSRS - Changing tab name when exporting to excel

I have tabbed my report in SSRS 2012 by having my page breaks based upon grouping classname and it works great. How do I change the tab names when exporting to Excel? I tried having an expression for page name =Fields!classname.Value. In doing so, it makes all 4 of my tabs equal the first page break of Sales Division.
My tabs are based upon the grouping of classname, which in returns gives me the 4 tabs: Sales Division, VRS, ClearCaptions, and IP-relay.
You need to set the PageName of the Tablix Member (group), NOT the PageName of the Tablix itselfs.
If you got the right object, if will say "Tablix Member" (Tablix-Element in German) in the title box of the properties grid. If it's the wrong object, it will say only "table/tablix" (without member).
Also, be advised to set the sort order of the group expression, so the tabs are alphabetically sorted.
If you get the tablix instead of the tablix member, it will put the same tab name in every tab, followed by a (tabNum). That is exactly your current problem.
This solution was not working for me.
I had to add group break page.
https://www.mssqltips.com/sqlservertip/3527/export-sql-server-reporting-services-report-data-into-multiple-excel-worksheets/

MS Access VBA Cross tab report legend sort order

The problem is hard to explain ,
I have an access report with a stacked bar chart to show the percentage fills over time like the one in this example : Click here
The legend for the chart i have is a number followed by the name, for e.g
1-Mango
2-Apple
3-Banana
etc
I want to sort this according to the above format but when i have more than 10 items the 10-Pineapple comes before 1-mango when it should appear after 9-somefruit .
The underlying query for the access report uses a Cross Tab query in which the items are created as
Column heading:[PrefixPriorityNumber]&"-"&[FruitName]
I even used the Sort:Ascending but it still doesnt affect my custom ordering that i wanted to show.
I also tried to google "sorting alpha numeric strings" but this is clearly more than that.Any assistance is appreciated
The problem is you are getting a text sort. You need to format the prefix number.
Column heading: Format([PrefixPriorityNumber], "00") & "-" & [FruitName]
Either use another digit, as Remou suggests (01 instead of 1) or start using letters. A > 9, B > A, etc.

SSRS - How to build a simple multi-column report?

I am using SQL Server 2008 and I want to show 1 single field from a table in multiple columns in the report. Just like if I were to print labels. How can I achieve this?
Example:
Instead of printing:
Names Report
Andrea
Austin
Barbara
Bob
Bruno
Cathy
Chis
...
I want to print in columns (say 3 fixed columns):
Names Report
Andrea ---- Bruno ---- Darren
Austin ---- Cathy ---- Francis
Barbara ---- Chis ---- Gabriel
Bob ---- David ---- Gerald
....... ---- ....... ---- .......
Edit: If I run the report and click on "Print Layout" button, I can see multiple columns. Can I set this mode as default?
For Horizontal layout of labels...
One choice is to use the columns property on the report or body elements.
This doesn't always display correctly On reportviewer. I've noticed that even if it displays correctly on your IDE and when you export to PDF. In the report viewer it will display only one column. Also it snakes the labels top to bottom then left to right.
One choice is to use a matrix and group on every 3 rows (if you want 3 columns).
This one is a little complicated.
My solution of choice is to put 3 vertical lists on the page. put the same label in each list. Return the row number in your dataset. Then just filter each list on modulo 3
For example
Result set
RIndex Fname
1 abe
2 burt
3 fred
4 george
Filter expressions
list 1 -> =Fields!RIndex.Value mod 3 = =1
list 2 -> =Fields!RIndex.Value mod 3 = =2
list 3 -> =Fields!RIndex.Value mod 3 = =0
Result
Abe Burt Fred
George
The method I use is a bit similar as what Vern suggested but differs enough to make it worth mentioning here.
You can combine the ROW_NUMBER with the modulo (%) operator directly in the query to fabricate the column number in which the record should get displayed. Here's an example that generates one while taking a group into account:
declare #numberOfColumns int = 4;
select dpc.EnglishProductCategoryName, dp.ProductAlternateKey
, (ROW_NUMBER() OVER (
PARTITION BY dpc.EnglishProductCategoryName
ORDER BY dp.ProductAlternateKey) + #numberOfColumns - 1) % #numberOfColumns + 1
as DisplayColumn
from dbo.DimProduct dp
inner join dbo.DimProductSubcategory dps on dps.ProductSubcategoryKey = dp.ProductSubcategoryKey
inner join dbo.DimProductCategory dpc on dpc.ProductCategoryKey = dps.ProductCategoryKey;
To get this displayed I'm using nested tables which are then filtered on DisplayColumn.
Have a read through following article for all the details: Creating Multiple-Column Reports
Use the 'Report' menu in Visual Studio and select 'Report Properties'. You can set columns in the 'Layout' tab.
Try this msdn article about newsletter-style reports for more details: http://msdn.microsoft.com/en-us/library/ms159107.aspx
This method does have a limitation though so in some cases it might not be applicable:
Only PDF and Image renderers support
newsletter-style reports.
EDIT:
So one approach is to use multiple tablix with a filter that checks RowNumber and accordingly displays particular records in each table.
The other way is called Newsletter-style report (link). This formatting is retained only when report is exported as PDF or Image. It can be previewed only when you select 'Print Layout' on the Preview tab in Visual Studio. Here is an example:
Create a new report with the foll. dataset: SELECT ID,NAME FROM TABLENAME
Add a new table to the report and select the ID and Name as columns
Click on the tablix and press F4 to edit the tablix properties. In the properties window, change the Size - set the width to 2in
Click on the report area outside the report page boundary and press F4 to edit the report properties. In the properties window, change the Column value to 3, and column spacing value to 0.1
On the report scroll to the right hand side, you will notice that there are 2 new columns (so totally 3 columns on the report - because you selected 3 in step 4 above). Now click on the margin at the start of the column 2 and pull it further to the left to bring it as close to the column 1. This is only to reduce the need for huge page size.
Right click on the report area outside the report page boundary and select Report Properties. Change the Page Size - Set the width to 10in
Preview the report. Now select the 'Print Layout' tab to see the result. This formatting is retained only when report is exported as PDF or Image.
As noted in points 5 and 6 - since the report body flows into multiple columns, you must ensure that the page size is at-least equal to -> ([Original report body size times the number of columns] + all the column spacing values). Otherwise it will look messy.