SSRS - Setting Table Row Height - reporting-services

I'm working in a SSRS report. I have a table in the report. How do I set the row height of the rows in the table?

Select the row you want to change the height of. With that row selected bring up the properties pane (Alt+enter if you don't see it). Scroll down to the position group of properties and specify the width and height there. The "cangrow" and "canshrink" properties are useful too sometimes.
Hope that helps!

Select one cell in a row , go to properties, go to size, give width and height and dis-select "allow textbox height to increase" and "allow textbox height to decrease" in textbox properties. Then it will effect on whole row.

You can edit the RDL(C) and set it exactly using an XML editor.
Look for the following:
...
<TablixRows>
<TablixRow>
<Height>1.5in</Height>
...
Note that you must have set the row height before there will be a Height node.

Since a tablix row doesn't have a dynamic height property (only CanGrow and CanShrink properties), I came up with a workaround.
You can use the length function LEN() in the Value expression for a cell in the row you want more height and add whitespace to the bottom (or top) of the cell with <br/> tags, thus effectively changing the row height dynamically.
To do this, first in the Placeholder Properties of the cell, change the markup type to "HTML - Interpret HTML tags as styles". (Just like changing the static row height property for a cell, this will change the height for the entire row.)
The "dynamic" whitespace you add to the bottom (or top) of the cell depends on how many <br/> tags you append to the value. Here's an example to add whitespace to the row if the cell has a value length of 100 or more characters (increasing the whitespace for every additional 100 characters in length).
=IIF(LEN(Fields!myText.Value) < 100, Fields!myText.Value,
IIF(LEN(Fields!myText.Value) < 200, Fields!myText.Value + "<br/><br/>",
IIF(LEN(Fields!myText.Value) < 300, Fields!myText.Value + "<br/><br/><br/><br/>",
Fields!myText.Value + "<br/><br/><br/><br/><br/><br/>"))))))
Make sure the CanGrow and CanShrink properties are set according to your needs. (For the example above, CanGrow is set to True.

From the Microsoft documentation Change Row Height or Column Width (Report Builder and SSRS):
In Design view, click a cell in the table row.
In the Properties pane that displays, modify the Height property, and then click anywhere outside the Properties pane.
Changing the height of one cell appears to affect the whole row. It worked for me.

Related

SSRS - hide a column and change width of other column

I'm creating a report that has 5 columns. However, one column can have no data and in that case I need to hide it. This works using the 'Hidden' property of column but when the column is hidden, I want to make the first column wider. Is there any way to do this in expression?
The only solution I found is to have multiple same tablixes with different column count and then show or hide each tablix appropriately if the specific column has no data. (by checking 'Max' value in column).
Unfortunately, it's not possible to enter an expression to the column width property but if you simply need to change the width of one other column when the first is hidden, I've come up with a workaround that works fairly well.
The idea is a little easier and requires less data to load than your current solution. Basically, you'll create an identical width column that is simply empty -- but set the borders to appear as if it is simply part of another column. So you'll simple reverse the expression used to hide the column with no data in the hidden property. To achieve this, depending on where you choose to add the extra space column, you'll have to adjust the borders of the adjoining cells where there is no right border on the cell to the left and a left border on the cell to the right. Depending on your layout, you would only need a top and bottom border on the extra space column cells.
I did something similar with a report that has 3 pages and 11 columns -- but 8 of the columns changed from page to page. I had to hide one column, show another, and used expressions in column headers and detail rows to simply change the data in each column based on a field that returns the type of the data.

Bootstrap grid layout: force specific cells to always be in the same row

Using Bootstrap Grid Layout to show various forms. Cells are assigned width (e.g. 3 of 12 columns) and all of it is configurable. The problem is Label and Field width are supposed to be configured separately. E.g. labelA is width 2, fieldA is width 4, labelB is width 2, fieldB is width 4. This way user will see "2 column" layout: labelA-fieldA-labelB-fieldB.
However there's a problem if user decides to set label and field width to some other value, for example to span all row. User sets label B width to 4 and field B width to 8 expecting it to take whole row. However, in this case he'll get labelA-fieldA-labelB-[empty space for 2 columns] on the first row and fieldB on the second row. Obviously the intended solution would to have labelA-fieldA-[empty space for 6 columns], then labelB-fieldB on the next row. Again, this is all configurable so I need solution for all cases.
A perfect solution would be to have some way to force those cells (label and field) to be non-breakable. Can't find the way to do that.
Another way would be to create a container component with width=label.width+field.width. But then I'll have problems with setting label and field width inside of those containers because I can only set label/field width relative to direct parent and I need to set width relative to the parent's parent. I've heard there are ways to change number of columns in component on render and it'd work if I set number of columns to label.width+field.width. But as far as I understand it's a dirty solution.
The code is in React and this is what's generated for each label and field. InpComp may be any component, doesn't matter in the end. labelWidth and fieldWidth are set by configuration.
const labelWidth = this.getLabelWidthFromConfiguration();
const fieldWidth = this.getFieldWidthFromConfiguration();
return (
<div className={'component-container'}>
<div className={'col-md-${labelWidth}'}><b>{this.field.attributes.label}</b></div>
<div className={'col-md-${fieldWidth}'}>
<InpComp />
</div>
</div>);
What can I do to this code so that those label and field always end up on the same row?
what about an if-statement? ;)
you can do something like this:
if (lableWidth + fieldWidth !== 6) {
fieldWidth = 12 - lableWitdh;
}
This solution only works for one case (LA+FA = LB+FB = 6). You could set a condition for each case by your own using if/else or switch-case.
Like Troyer said, we're not here to show ideas or do your work, we are here to fix code problems. Next time you should try to solve your Problem by your own until you get in stuck and then provide your Code.

How to prevent a column to grow width and push other column in Word?

I've tried this for 2 hours with no success.
I have a report viewer with a table with some columns. The problem is that depending on the lenght of a "Description", the column gets bigger than Microsoft Word margin, so it pushes the next column, so my another column disappears.
I already set CanGrow = true to everything, I also mixed with False value, and mixed with CanShrink.
How can I freeze the column Width?
The problem only occurs on Word. I also noticed that if I click on the table in the word document, and select > Auto Adjust > Fixed Width Column, it fits well. but I can't ask the user to do it manually :P
.
In this picture, the "COL E" pushes the next column because there are other row way down with a huge description.
I have used your second paragraph as a details column with following parameters:
CanGrow - True
CanShrink - False
. The results are below:
If you set CanGrow to False then Details column will be cut off ending "I have a report".

Dynamic row height for table

Using Reporting Services I need to make a table where I can set the row height dynamically depending on the length of the text in the cell, so when I export in Excel the height of the row will expand accordingly to a size that can be printed out without hiding any information It is in that row. I noticed that there is a problem with exporting in Excel, and that the propriety 'CanGrow' is not really working to expand the row height as it should.
So, there is a way I can set a height for every table row, or a method to make Excel export with a correct height every row depending on the length of the text in the cell?
Try this code. I have used this code to set the height of row according to length of text:
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
float a = 54.0f * [[yourArray objectAtIndex:indexPath.row - 1] length]/25.0f;
return a;
}

SSRS - how to check if a row is toggled or visible?

I have a drill-down report in SSRS 2008 and I want to do some conditional formatting on the main row. For example, if it's not toggled add a different background color and different border.
I haven't been able to figure out how I can check if the current row is expanded or not using an expression.
There is a trick(check the result to see if it's ok for you. this solutions leaves a small space when the group is expanded) :
Add an extra column at the left for expand collapse.
Add a second row in the group with color.
Set expand/collapse only to the first row textbox
In the expand/collapse column set the second row textbox visibility to hidden.
Set the first controls(only at the textboxes) visibility to visible and the second to hidden, except the column with expand collapse. Set the first row textbox as the toggle item
Set both rows height to 0 (althought is will be automatically set to a very small value)
Now your report should look like the image below