Means the text should be visible in a single line.
Not very clear what you mean? May can you post an example?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a Ssrs report and I want to download the Ssrs data on excel but the text in any column should not be wrap. Means the text should be visible in a single line.
Means the text should be visible in a single line.
Not very clear what you mean? May can you post an example?
Hi @Abhishek Srivastava ,
There are CanGrow and CanShrink properties to control the text box expand or shrink vertically based on its contents. However, the CanGrow property only indicates that the text box height can increase to accommodate the contents but not the width.
By design, width of textbox or table column is always static. So, in order to prevent the word wrapping, please increase the width of the column if possible.
Best Regards,
Joy
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
I know this is a bit late but I get around this by adjusting the Top and Bottom Padding and setting the Can Grow property to False.
The only problem is, if the string is too long to display, it trims at the space and moves the remainder of the string to the next line, which is not displayed.
The O.P. Wanted something like:
THIS IS A STRING THAT I WANT TO TRUNCATE
To appear in a fixed-width column as:
THIS IS A STRING THAT I WANT T
Instead of:
THIS IS A STRING THAT I WANT
TO TRUNCATE
With SSRS and my suggested solution, you would get:
THIS IS A STRING THAT I WANT
Sadly, this is less effective with longer words. I feel that the community would like a behaviour similar to Excel, where the text within a cell is simply printed right up to the beginning of the next cell (providing it is not empty).
|Text in cell 'A' goes up to he|Text in cell 'B' goes up to here because it's a wider column. |Cell 'C' |
I hope that's enough examples to demonstrate the intention.
Has there been any other updates on this subject? We tried the can grow/shrink properties but it does not work.
I searched for a long time for this and never found a solution. I broke down today and wrote one.
Called with this as the expression for the textbox:
=Code.FitWidth(Fields!JobComments.Value, 8, 1.523)
The string to fit ...Value
The font size
The width of the text box in inches.
The Code
Public Function FitWidth(tempStr as String, iFontSize As Integer, size as Decimal) as String
Dim bmpImage As New Drawing.Bitmap(1, 1)
Dim iWidth As Integer = 0
Dim iHeight As Integer = 0
Dim temp as String
size = (size * 72) '// I want in units in points
'// Create the Font object for the image text drawing.
Dim MyFont As New Drawing.Font("Arial", iFontSize, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point)
Dim MyGraphics As Drawing.Graphics = Drawing.Graphics.FromImage(bmpImage)
MyGraphics.PageUnit = System.Drawing.GraphicsUnit.Point
iWidth = MyGraphics.MeasureString(tempStr, MyFont).Width
iHeight = MyGraphics.MeasureString(tempStr, MyFont).Height
while (iWidth > size)
temp = Left(tempStr, Len(tempStr)-1)
tempStr = temp
iWidth = MyGraphics.MeasureString(tempStr, MyFont).Width
End While
Return tempStr
End Function
There is probably a better way math-wise to do this but it works.
Craig