How can I add TextBoxes to an existing Matrix in an SSRS project? - reporting-services

Why is it that a control that appears in the property list in a BIDS project is not represented in the corresponding .rdl file?
Let me step back a bit; I'm having a heck of a time trying to figure out how to add items to an existing report, either via the XML (.rdl viewed as code) or on the design surface. I can click on a rectangle on the design surface and see a column row above it:
And if I click on the "pipe"-separated segements on that column heading row, I see "MatrixColumn4", "MatrixColumn3", "MatrixColumn2", and "MatrixColumn1" in the designer; for example, here's MatrixColumn3:
However, only one of these columns appears at a time in the Property list - if I select MatrixColumn3 on the design surface, MatrixColumn1, MatrixColumn2, and MatrixColumn4 are not there. The same holds true for selecting any of the others - it turns up temporarily in the Properties list but "hides" all the others:
Stranger yet, when I search the .rdl file (viewed as XML) for "MatrixColumn1" (or "2" or "3" or "4") they do not exist there. In fact, the only reference to "MatrixColumn" in the entire file is this:
<Matrix Name="matrix1">
<MatrixColumns>
<MatrixColumn>
<Width>1.67609in</Width>
</MatrixColumn>
</MatrixColumns>
. . .
This seems exceedingly bizarre - shouldn't there be four sets of <MatrixColumn></MatrixColumn> there?
I want to add another column heading, with a Textbox-as-label and a Textbox below that to display dynamic content, but how can I do it without adding another column heading?, or at least making room for this new column?
I can increase the width of the matrix ("matrix1") by dragging it or by increasing its Size.Width value, but its existing contents expand with it, giving me no room to add TextBoxes inside of it.
Maybe I'm approaching SSRS from a completely wrong mental angle, as I don't see much of a connection between what the report generates and what I see on the design surface and in the XML.

To add another column to a matrix right click the column header and Select Insert column. Then choose either inside group (left or right), or outside group (left or right).
A column created inside the group will repeat for every item in the column group
A column created outside the group will only appear the once to the left or right of the grouped columns.
Are you sure you are referring to a matrix (dynamic columns and rows) and not a tablix (dynamic number of rows only)?
The process for tablixes is the same as for matrixes as described above, just without the inside/outside group option.
Either method described above will include a new column with a single text box to label the column with, and another text box underneath to put the detail in.
You can also do this process by dragging a field from your dataset in the Report Data panel to the appropriate location in your existing table.
Please let me know if this helps, or if I've misunderstood your question and you require a different solution.

Related

Hide multiple rows or columns in SSRS report with same Expression at same time

I have a report containing a Tablix/table with sets of rows and columns which I am hiding conditionally using Expressions, via the Column/Row Visibility dialog.
If for example I have 3 columns which I want to all have the same Expression to determine their visibility, is there any way for me to achieve this without opening the Column Visibility dialog for each Column and entering the appropriate Expression?
I've tried selecting multiple columns, but then the right-click context menu no longer offers the Column Visibility option (it's greyed out) and I have also tried out the Hidden property of the columns (which can be amended in bulk by selecting multiple columns), but this only stops the columns from being rendered, leaving a blank space where they used to be (rather than how Column Visibility works, where columns to the right of the hidden columns are moved across to fill the gap, like hiding columns in an Excel sheet).
Is it possible to achieve what I'm after, or will I have to continue opening the Column/Row Visibility dialog for each column/row I wish to conditionally hide/show?
If the columns you want to control the visibility for are next to each other, you can create a Column Group for them and manage the visibility via the Group.
Add a new column group at the appropriate level so that only the relevant columns will be included.
If you already have Column Groups this will likely be a Child Group or an Adjacent Group.
If not, you can create an initial Column Group by dragging a Dataset field from the Report Data into the Groups pane.
Insert new columns inside the new group, and move the data from your existing relevant columns into the group.
The new group does not need to repeat, so in it's properties window set Group on: to a plain text value, e.g. "1".
Input the desired visibility settings into the Visibility page of the properties window.
For each of the individual columns inside the group set the Hidden property to False, to remove any other expressions or settings that might interfere.
Not exactly what you are looking for but perhaps a midway point - and this can apply to many things other than visibility (e.g. background colour, tooltip) - edit the RDL directly using View Code. This has the added benefit of being able to implement changes that are almost identical per column instead of identical with a minimum of mouse usage.
Typically I have set one column up the way I like it in the designer and then copy/paste under the other columns. In the case of visibility look for <TablixColumnHierarchy><TablixMemebers>. You will see a list of empty <TablixMember /> items along with the expanded <TablixMember><Visibility><Hidden>=... block where you have set up one column. Simply copy paste that block over the empty items at the position of interest (you will need to count it out unfortunately as there are no identifiers).
Bonus Tip: If you make a mistake or want to change something later, you can do a replace on all expressions at once (optional regex allowed).
Remember to backup or check in your work first because the designer may not open that report again correctly if you make a mistake :-)
Select the columns you want to conditionally hide and press F4 to see the Properties Window. Look for the Visibility node and use the Hidden property to set the conditionally expression.
The expression should evaluate to True for hiding and False for showing.
Let me know if this helps.

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.

Report Side By Side

I've managed to create a report template and use it inside another report, as a method of replicating a "template"...
The filled template is like this:
As you can see, this is not a wide template, and i can fit 3 of it on a regular page... my problem here is that the best i could achieve so far is vertical replication!!!
What i'm looking for here is a way to say "fill all the 'columns', then, move to the following line"
Anyone ever managed to do this?
Details:
Using SSRS 2008 R2
Using BI tools for VS 2013
There are a few ideas that spring to mind.
Add three columns to the report via the Report.Columns property and have the detail fill top to bottom then left to right. (This may not be ideal as you stated you want a left to right, to bottom flow).
Duplicate any number of mailing labels samples on the internet substituting your sub-report as the detail.
Create 3 Table's with three detail data sources and have the data source return the id's for your sub report ordered in a Take(1) Skip(2) left to right, up to down fashion, basically three partitions of data ordered by some value.
Create a Table with three columns and place a sub report in each column. Have the data return in a A-B-C | D-E-F | G-H-J fashion.
Create a Table with one column and place a column group on a value that will return 1-3 for your detail records, pushing your columns out to desired column width.

How can I make a simple flow chart in SSRS?

I come to you with a question on how I can create a simple flow chart like in the pictures below in SSRS. I have a query that returns rows with events, and a date column that I can use to organize these events in chronological order.
I have it all basically set up but I am running into a design problem. I have a tablix with two columns in a group for the box+arrow combination, with column visibility set up to hide the arrow if it reaches the last event. What I would like to happen is for the boxes to reach the end of the page (the rightmost side of the page, and then come down a short distance below that row of boxes and continue on the same page (Ex. B). What it's doing is reaching the end of the side of the page, and breaking to the next page, effectively creating a bunch of pages with only one row of boxes on each page. (Ex. A)
Ex. A: What it does:
Ex. B: What I want it to do (accidentally forgot to include the arrow on the middle rightmost box in the picture, the second and third rows are just continuations of the first obviously):
I would almost call it row wrapping but it's not exactly the same. To bring the problem away from my specific flow chart design, I want to make tablix columns wrap down directly below the table (not the content inside the columns, the actual columns themselves).
I've done some reading on column groupings and interactive page size. I don't really understand the column grouping manipulation, especially when trying to apply it to my situation, and the interactive page size doesn't seem to be what I am looking for either. Any help on this would be really appreciated!
I suggest you use a multi-column layout, e.g.
http://nederveld.wordpress.com/2010/02/15/how-to-do-a-column-layout-in-sql-reporting-services/
Each of your Box + Arrow pairs would go into each cell.
I'm a bit confused about your arrow requirement, you might need to use an expression based on RowNumber to hide the arrow in the last column.

Labels in fields within an SSRS report

I am attempting to reproduce a form within SSRS and fill it with data. The original form has blocks with small labels inside of each box that identifies the entry requested.
I "thought" I could simply use two different tablixes: one for the blocks with borders and labels, and the other one with the actual datafields or expressions, and align the 2nd tablix directly over the first one so that it appears as though the fields are presenting data inside of the labeled boxes.
It looked as I wanted it in design view, but when I went to preview the report, it pushed the 2nd tablix below the first tablix, in effect creating two tablixes, one stacked on top of the other one (not displaying as how I intended).
So, how do I accomplish the form design in the manner that I am seeking?
You should be using a type other than tablix for your report. Use a 'List' instead and you can free float objects as you need them and also nest a tablix as well. A little explanation on list:
You can float images with text boxes and then even change syntax or draw boxes around them and decorate those.
The call out for a field in SSRS is [(value)] with the [] meaning: "Data Column in recognized Dataset"
You can call out Variables with an '#' in front of them [#Test] would be a variable a user would put in called 'Test'.
Whatever size 'List' element is will determine how large it is when it repeats. If you want a strict form ensure the length and width are set correctly on the properties of that element.
If you want it to break every page you can click on the 'List' > Right Click the top left corner > Properties > 'Add a page break before' checkbox.
My example shows a super simple textbox with a dataset that only has three ideas repeat as many times as there are id's, three times. You can apply this to your form as needed.
It looks like you could reproduce that form header quite easily with a single tablix. If you envisage the form as a set of tablix cells like so:
then all you need to do is set the Border properties for each cell to hide the borders as needed (or you could merge the cells e.g those for Applicant and Location).
You can use a tablix with only Header rows, deleting the detail row. If you need multiple forms per report, then put the tablix inside a List region.