SSRS Report Builder 2012 - How to hide list based on field value? - reporting-services

I'm using Report Builder 2012 to create a report. I have inserted multiple text boxes and other controls inside a list box so that I can hide all the controls at once just by hiding the list box. I'm using a SQL Server stored procedure to fetch rows of data. I'm using below expression to hide/show the list box.
=iif(Fields!certificateType.Value = "CT", False, True)
It works fine but it only checks the first row of data. If certificateType field is "CT" in the first row of data, it shows the list box but it doesn't hide the list box back for the next row of data in which certificateType is not "CT". It seems like list box visibility only checks the first row of data and applies it for all the other rows as well. How can i check the visibility of list for all the data rows?

Okay, based on our chat I have updated this solution.
I mocked up some data that looks like this:
certificateType
---------------
AT
BT
CT
DT
ZT
I created a quick and dirty report with a list. In that, I added a rectangle with a textbox in it. I set the dataset for the list to the main dataset (DataSet1 in my case). I set the expression for the textbox to this:
=Fields!certificateType.Value
Image in design mode:
I clicked on the list, and in the Row Groups pane, I right-clicked the Details rows, and chose Group Properties. On the General section, I clicked Add to add a new group expression. Then I chose certificateType from the dropdown.
I moved to the Page Break section of the Group Properties dialog and ticked the Between each instance of a group check box. Click OK.
Now, the report will break for each instance of a certificate type that comes in the dataset. So, if you have ten different cert types in the data, you will get one page for each.
You can't see it in my image below, but there are 5 pages now.
Hope this helps!!

Related

SSRS 2008R2 optional page breaks for tablix that has 5 row groups on the tablix

I am trying to use an existing page break parameter in a new tablix that I added to an exisitng ssrs 2008 r2 report.
I am trying the solution at http://stackoverflow.com/questions/15513313/conditional-page-breaks-at-group-level-in-ssrs2008-r2-reports/ so I can use the disabled property of the page break option on on the new tablix by using a parameter value that is 'text' and the parameter values are either True or False.
The new tablix that I am using has 5 level of row groups.
The problem is I do not see a 'group' property where I can set the control group name.
When I do set the pagebreak of the tablix I am working with to the following, =IIF(Parameters!PageBreak.Value="True",false,true), and run the page break parameter to true, I do get the page breaks. However when I set the page break parameter to false, all I see is information for one control group. I am basically missing all the informatiuon I need.
How do I solve this problem?
Click on the horzontal bars under the Row Groups. If you click for example on [StudentFullName your property pane on the right side changes to the group properties (Properties: Tablix Member). There you navigate to Group > Group > PageBreak > Disabled. Now put your expression in the Disabled property. Just follow the steps from the other post and you are done.
UPDATE
If you want a page break before each new item of a group right click on your group properties (in your case for example right click on [StudentFullName) then go to the tab page breaks and check the Between each instance of a group box.

lightswitch many to many checkbox filter

Hey guys I have a many to many checkbox where a user can select many cities. I have a dropdown list above for selected state. I want to bring back only the regions that belong to that state that is selected.
thanks
Have you considered using a List and Details Screen instead of a dropdown list? You would just need to add both the states and cities tables to the advanced data section.
However, if you really need to use a drop down box, it is very complex but can be done.
You will need to begin a new search screen and lay it out as follows:
Create a group to start. You will need to 'add data item...' and choose Property, StateTable. Name this 'State' and add it to the group.
Create a second group. Again 'add data item...' Choose Query, CitiesTable (All). Name this StateCities. In the side panel, click 'edit query' next to StateCities and set it up as follows:
Return to your design screen by clicking the 'back to -screenname-' just above the filter statement. You should now see three bold items in the sidebar to the left. The first will be your StateTable, the second will be your StateCites query and the third will be your single State query.
Click the dropdown button for the StateCities query and you will see the query parameters at the bottom. You have a parameter called 'id'
Click on the Id parameter from the sidebar and change the parameter binding property (shown on the right hand side bar) to State.Id. If everything has been done correctly, this should hook up to your state query id field.
Once this is hooked up, you should be able to save your screen and run your program with the desired results!

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/

Only allowing one Drilldown in SSRS

It took me hours of searching and putting together piecemeal parts to find the solution to this, so I figured I'd post it on here in the hopes of helping someone else.
The Problem: We need to display a report, with proper grouping and drilldowns. However, we should only allow one group to be drilled down at one time.
SSRS doesn't exactly have robust scripting options - for instance, you can't close other groups "on click" or anything like that. So how do you do it?
In My example i'm using the AdventureworksDW database. I want to have a dataset that includes the total sales for each group and region. My Stored Procedure looks something like this:
SELECT dst.SalesTerritoryGroup,
dst.SalesTerritoryRegion,
SUM(fis.SalesAmount) AS SaleTotal,
DATEPART(YEAR,fis.OrderDate) AS OrderYear
FROM [dbo].FactInternetSales AS fis
INNER JOIN [dbo].DimSalesTerritory AS dst
ON fis.SalesTerritoryKey = dst.SalesTerritoryKey
WHERE fis.OrderDate < #QueryEndDate
GROUP BY
dst.SalesTerritoryGroup,
dst.SalesTerritoryRegion,
DATEPART(YEAR,fis.OrderDate)
UNION ALL /*The ResellerSales table. Same info.*/
From there I added a table with two groups: SalesTerritoryRegion and its parent, SalesTerritoryGroup. I also added a column to the left INSIDE the SalesTerritoryGroup, with an X (this can also be an image if you'd like). This is the "Drilldown" button that we'll use.
Create a string parameter, mine was #ExpandedGroup. Set the Default to an empty string (so that all the groups start out collapsed). Right click on the SalesTerritoryRegion group, or whatever your subgroup is, and go to the visibility tab. Click "Show or Hide based on Expression" and enter something like this:
=iif(Parameters!ExpandedGroup.Value="" or
Fields!SalesTerritoryGroup.Value<>Parameters!ExpandedGroup.Value,True,False)
This statement means: If we haven't opened a dropdown, or if the dropdown isn't the one selected, set hidden to true. Otherwise, false.
Next click on your "X" column to the left of SalesTerritoryGroup or your supergroup. Right click to go to Textbox Properties. Click the action tab. From there select "Go to Report". When you specify a report, make the target itself (For instance, mine is Main). Then, add parameters to the report.
The most important here is ExpandedGroup. The name should be ExpandedGroup, but the value is not just [ExpandedGroup]. Instead, it's an expression:
=IIF(Fields!SalesTerritoryGroup.Value=Parameters!ExpandedGroup.Value,
"",
Fields!SalesTerritoryGroup.Value)
This expression says: If the Group is the same as the Expanded group, make ExpandedGroup an empty string when you load the report. Otherwise, send the TerritoryGroup value. Essentially, this will let us toggle on and off the drilldown (same as you would in the report if you had traditional drilldowns).
Note: Also be sure to pass other parameters! For instance, my query requires a date to exclude some transaction data. If you don't pass this parameter in the "Go to Report" action, then you'll have to enter it again when you DrillDown. This also means you can give yourself even more flexibility when you click a drilldown (changing a chart that's displayed etc.) which is what I'm doing for this project.
Hope it helps someone out! Of course, if there is a more elegant or simpler solution I'd absolutely love to hear it.

How can I show data in the header of a multipage SSRS 2005 report?

This question was very helpful, however I have a list control in my report, and when the report grows over 1 page, data in the header only shows up on the last page of the report.
Apparently, hidden textboxes have to be on every page of the report for header to function properly. How do I do that? The only control I have in the list is a textbox with bunch of text that grows way over 1 page.
Although SSRS does not allow us to use DataSet fields in page headers, it allows us to refer to report items. So we could place a textbox (that takes its value from a DataSet field) anywhere in our report's body and set its Hidden property to true.
Then, we could easily refer to that textbox in the page header with an expression like: =ReportItems!TextBox1.Value and we are done. Note that the textbox that is being referred should be present on every page, or otherwise the header will print an empty value.
sExchange website to the rescue!!!
All I needed to do is to use Report Parameters with queried values from my dataset; and then reference =Parameters!Name.Value in the textbox in the header of the report.
Select Report Parameters, Add new parameter and check hidden, allow null and allow blank value.
If you are retrieving the values from database:
Under Available Values:
check "from query" radio button and provide dataset,value field and label fields.
Under Default Values:
check "from query" radio button and provide dataset,value fields.
Now provide the value for text box in the footer/header as =Parameters!Footer.Value (Footer is the parameter name).
the hidden text boxes can be placed within a rectangle that was a repeatwith property set to be your list item.