Handling of very long strings

Visayas 0 Reputation points
2025-07-01T13:28:53.6066667+00:00

Hi!

We are trying to include a (sometimes) very long string into our reports, rendered with SRSS.

Due to the nomenclative background of it (ISCN), the string does not contain a lot of spaces, where breaks are able to occur. There are however places we know of, where we CAN put breaks, if the page ends close to it.

Right now our staff creates the reports and puts the line breaks manually in the rendered word document since otherwise the string just overflows the document.

Is there some possibility to include an invisible character that signals the renderer, that it's an appropriate spot to put a line break?

Here's an example:

45,XY,i(8)(q10),del(11)(q?),der(13;14)(q10;q10),+der(20)t(20;22)(q?;q?),-22[5]/46,XY[3].nuc ish 8q24.21(MYCx3),8p11.1-q11.1(D8Z2x2)[11/100],11q22.3(ATMx1),17p13.1(TP53x2)[33/100],14q11.2(5'TCR,3'TCR)x2(5'TCR con 3'TCRx2)[100],14q32.1(5'TCL1,3'TCL1)x3(5'TCL1 con 3'TCL1x3)[55/100],20q12(PTPRTx3),20q13.3(RH74808/RH67654x3)[60/100]

Preferred spots to break the line are after "]/" and "."and "],".

Would greatly appreciate any help, we've successfully automated the generation of the whole thing according to the nomenclature and this is the only thing missing!

Thanks!

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,066 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 60,341 Reputation points
    2025-07-01T15:30:01.49+00:00

    I'm not aware of a way to do that but there are a couple of solutions to your problem I believe.

    The first option is just don't worry about it. While the renderer wants to break on spaces and line breaks, it will still honor the size of the control it is rendering in. Set the control to the size you want (width generally) and let it break the text whereever it ends up within the control. Word wrap is nice, but it doesn't always work well.

    The second option, if you want to inject line breaks into the value, is to use a function that does it. Ideally this could be done when building the dataset results (in your SELECT or whatnot). Then it is easier to test before you get to the report.

    If that isn't an option then create a function that takes the text, inserts the linebreaks based upon your rules and then instead of binding directly to the field from the dataset, wrap it in a call to your function that calculates the correct value and then binds the result of the function to the control instead.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.