0

I've been searching and searching for an answer to my question, but I can't seem to find anything. Does anyone know of a way to wrap/float text around a chart or image in SSRS? I was hoping for some kind of option similar to the blue one below in Word, but no luck there:

Screenshot of text wrapping options in MS Word

I found the following post, which has a good example image of what I'm looking for, but doesn't have any helpful answers (I'm not using Crystal Reports, I'm using BIDS SSRS through Visual Studio 2015).

Crystal report (or SSRS) flowing text around image

I've tried the following:

  1. Overlaying a text box on top of the image (rendering shoves the image below the text)
  2. Trying to find or create a mad scientist algorithm that can split the text after a certain number of characters, but not in the middle of a word, chop off the rest, and continue the rest of the text in a separate textbox under the image (not a mad scientist, so no luck)

Thanks for any tips!

molleyc
  • 349
  • 2
  • 14
  • What version of SSRS are you using? – Pants Jun 06 '17 at 14:25
  • I am using 2012, but I believe that the Sharepoint server that we use to serve our reports is 2008 (I have no control over that - I've been asking for the last year to upgrade it). – molleyc Jun 06 '17 at 19:07

1 Answers1

1

There's no built in way to do this in SSRS.

Someone wrote a function that determines how many pixels are in a given text string.

Truncate textbox content with ellipsis in SSRS

Public Function TextWidth(str As String) AS Double
    'Returns the width, in pixels, of a string, assuming Tahoma size 8.
    Dim size As System.Drawing.SizeF
    Dim font As New system.Drawing.Font("Tahoma", 8)
    size = System.Windows.Forms.TextRenderer.MeasureText(str, font)
    TextWidth = size.Width
End Function

You may be able to use this to figure out where to make a break in the first text box and spill the rest to the second. You'd just need to do testing to figure out how many pixels of text your first text box holds.

Once you figure out how many pixels would fit (I would just fill the first text box with text then use the function to see how many pixels that text is), change the other TextCap function to return either the first or second part at the pixel split. You could add an Argument in the function to indicate whether to return the first or second part of the text. Then use the function in the first text box to return the first part and the second part in the second text box.

It's a bit of work but seems feasible. It depends on how bad you want it and how much time you have.

Hannover Fist
  • 10,393
  • 1
  • 18
  • 39