ssrs report collapsible/expandable grouping - reporting-services

I need to create collapsible ssrs report, please refer below.
Here is the sample of the report:
Header1(parentgroup) Header2
AAA BBB
CCC
DDD
supposed output
Header1(parentgroup)
AAA --as header
BBB ]
CCC ] -- collapsible
DDD ]

Right click the cell you want to have the +/- control in and click TextBox Properties. Note the value of the "Name" field. Exit that and click any cell in the table. You will see the grey column and row bumpers appear around the table. Right click the bumper for the row you want to collapse and select "Row Visibility..."
If you want it to be collapsed by default, set the radio button to hide. Then click the "Display can be toggled by this report item" checkbox. In the dropdown, select the TextBox name you noted above.
Run the report and you will be able to expand and collapse that row.
Note that if you "Show" by default, the button to collapse the row will be a + and the button to expand it will be a -. I have not figured out a way to fix this and believe it is a bug in SSRS.

Related

SSRS collapse empty field and collapse space also

My problem in SSRS: address lines 2 and 3 have no data
Pit ltd.
230 Sunset Blvd.
Field: Address Line 2
Field: Address Line 3
Singapore
Solution should be:
Pit ltd.
230 Sunset Blvd.
Singapore
How can I collapse these fields and also save space?
Edit: Alle these fields have to be single fields placed on the canvas. I cannot use a table due to different formattings for the fields.
You can add a visibility expression for the rows. You can also do this at a group level. Right click and go to row visibility.
Select "Show or hide based on an expression" radio button.
Click the expression button.
In the expression window, use Fields!AddressLine2.Value = NOTHING
Do the same for Address 3. Note I'm assuming your fields are named as displayed.
Update
For the same idea on a text box, just right-click the text box, go to text box properties, visibility, and use the same expression for the third option - "Show or hide based on an expression."

Filter a table based on a combo box value

I have two tables named "REPORTS" and "REPORT_NAMES". In REPORTS there are 2 columns "REPORT_NAME" and "DATE". In REPORT_NAMES there is only "REPORT_NAME" column. I created a combo box and a button in a form. All I want to do is when I choose a report from the combo box and hit the "RUN" button, "Query1" is to be run. "Query1" is like below;
SELECT * FROM REPORTS WHERE (((REPORTS.REPORT_NAME) = [Forms]![Form1]![REPORT_NAME_Label]));
But when I choose a report from the combo box and hit the run button query runs but gives a blank datasheet.
It should be [Forms]![Form1]![REPORT_NAME] which is the combo box instead of [Forms]![Form1]![REPORT_NAME_Label] which is the label.

SSRS validating parameters and stopping report

So I have two combo boxes, box1 and box2. The requirement from within SSRS is if box1 is selected set Box2 to None and if box2 is selected then set box1 to none. Now I don't think this is possible because you can only cascade parameters in one direction. Otherwise you get forward dependencies are not valid.
But the question becomes can I validate the boxes when they click View Report to display a msgbox saying Please either choose box1 or box 2 but not both
Note: I am still working in 2005.
As far as I know, View button code cannot be accessed. As a workaround, you can do the following:
Add a textbox in your report and let the text be something like "Please enter either cmb1 or cmb2" .
Now from the Database check if both Values are entered. If yes, just return the columns in your select statement as NULLs or specify a value e.g. EMP_NO = 9999.
In your report if the returned value for EMP_NO is 9999 by checking FIRST(fields!xx.value ) = 9999 you can determine what did the user enter.
Add an condition to the textbox visibility checking if the value is 9999 or not, do the same for other items in the report to hide them and just show the textbox.
This can be used for other validations as well.

SSRS Hide Item in Legend based on conditions

I have a problem related to the legend you can make use of in an SSRS report.
I have a stacked bar diagram in my report, let us call the groups series for Category. The bar chart will display as following:
Category A
Category B
Category C
Category D
...
I have different filters in this report which will only display two categories sometimes, e.g. Cat. A and Cat B. The problem is that the legend still will display all categories even if it is not displayed in the bar chart due to certain conditions made by the users.
I have tried a lot now but without any result. How can i display only Categories in the legend that only exists in the bar?
BR,
Nicklas
Right-click on a chart bar, select "Series Properties", choose Legend and click "fx" sign next to "Do not show this series in a legend". Make an expression, which hides legend for this chart bar, if the value is NULL or zero. Here you have an example" http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/0e145eb1-924c-488f-95b1-56028c4f03a8
Right-click on a chart bar, select "Series Properties", choose "Visibility", Select "Show or hide based on an expression", Give your condition(by clicking fx sign you will find condition pane). Example : If you want to show only not null values-
=IIf(Fields!Cat_A.Value is nothing,true,false)

How do I collapse elements in a Report Table?

I have an SSRS report where I need to collapse data into a summary column like so:
+Program
-Program2
Program2DataElement1 | Program2DataElement2 | etc.
How does one doe this? I see it in other reports, but can't for the life of me find the area to set it up. When I put in a group, I get something like this on all records:
Program
ProgramDataElement | ProgramDataElement | ...
What am I mising? Thanks in advance!
I believe these are the steps:
Edit group
Click on Visibility Tab
For Initial Visibility, select the "hidden" radio button.
For SSRS 2008 - We have:
Select Group Properties for Program2DataElement at Row Groups
Select option Visibility
When the report is initially run: Hide
Check Display can be toggled by this report item: Program2