0

I'm currently returning a string of Jira Keys in an SSRS report (e.g. ABCD-1234, ABCD-1235, ABCD-1236, ABCD-1237), for formatting reason I don't want this to line break in the middle of a key.

e.g. I want this:

|                           |
| ABCD-1234,ABCD-1235,      |
| ABCD-1236,ABCD-1237       |
|                           |

Not this:

|                           |
| ABCD-1234,ABCD-1235,ABCD- |
| 1236,ABCD-1237            |
|                           |

I can't seem to find a chr() or chrW() code to replace the current dash being returned by the SQL query (called as a proc so can't be amended directly in SSRS itself). Is there a way to replace this in SSRS or am I best looking to amend the original SQL proc to return a non-line breaking dash?

Ben R
  • 1
  • 2
  • You can use character replacement with non breaking dash =Replace(Fields!JiraKeys.Value, "-", ChrW(8209)) . Similar solution https://stackoverflow.com/questions/7691569/no-line-break-after-a-hyphen – niktrs Jun 08 '21 at 12:55
  • Yeah I've tried ChrW(8209) but appears to be unrecognised when running (returns an empty square). – Ben R Jun 10 '21 at 08:27
  • Actually I take it back, ChrW(8209) is recognised on a browser when running the report. The issue is that the non-breaking hyphen isn't rendered on preview in Report Builder. Although another problem now is that on export as pdf the character is again not rendered correctly. Guessing there's no way around that one though. – Ben R Jun 10 '21 at 08:39
  • Check also this with wikipedia page with dash codes https://en.wikipedia.org/wiki/Wikipedia:Hyphens_and_dashes and see if another code works for you – niktrs Jun 10 '21 at 08:39

1 Answers1

0

As niktrs stated, ChrW(8209) can be used to replace the line breaking hyphens. It appeared this wasn't working due to the Report Builder preview not rendering this character correct. Upon publishing the report, the non-breaking hyphen is rendered correctly on the screen.

Although, this do not appear to be supported in exports of the report such as pdfs and is not rendered correctly again: https://i.stack.imgur.com/zK0tG.png

Ben R
  • 1
  • 2