Notes field with can grow splits a word

  • Does anyone have a process that ensures then when a notes field (255 characters) is in a field than can grow it puts in a return in suitable places so that words at the end of the lines are not split in 2?

    This is the sort of note that doesn't display well:

    "Editing press releases; finding and sending along link to interview from Th

    ursday's relevant radio show"

    Notes can be longer than this and I can't make the field wide enough to appear on 1 row becuase that would make the whole report unreadable!

    Now doubt it will need some code to do it, I'm not expecting SSRS to do this natively.

  • martin-325528 (5/4/2012)


    Does anyone have a process that ensures then when a notes field (255 characters) is in a field than can grow it puts in a return in suitable places so that words at the end of the lines are not split in 2?

    This is the sort of note that doesn't display well:

    "Editing press releases; finding and sending along link to interview from Th

    ursday's relevant radio show"

    Notes can be longer than this and I can't make the field wide enough to appear on 1 row becuase that would make the whole report unreadable!

    Now doubt it will need some code to do it, I'm not expecting SSRS to do this natively.

    Just rechecked but SSRS should do this natively and by default.

    As a check I create a report based on the Product.ProductDescription table of Adventureworks2008, then created a table and added the Description field to the details row. No problem at all the field wrapped properly in all rows.

    Can you give more details? Is this a standalone textfield or in a table?

    Fitz

  • Hi Fitz,

    It's a field (char(255)) in an existing table. The example I gave was how it was displaying in SSRS with it wrapping after the "Th" and before "ursday".

  • Not sure what to suggest. The only way I can get it not to split correctly is by having the column width of the textbox to be shorter than the longest word. This is obviously not the case for you. Is it just that one report or do all of your reports do the same? Could you try creating a new report with the textfield only and see if that wraps? This could narrow down the issue to a single report / field or a general problem.

    Fitz

  • How does it display in SSMS? If you look at the raw data, is it correct?

    I'm guessing that you have some word wrap issue in SSRS. Does the text box automatically grow to accommodate the data?

  • Hi Fitz,

    It's all reports (I created a very simple one just know to re-test that) for any of the notes fields we have in the database. I'm not sure how SSRS is doing it natively for you. Did you set anything special on the box properties?

    Martin

  • Steve,

    The raw data looks ok. In SSRS yes the box grows in height automatically but the letters wrap at the end of the width of the box regardless of whether it's splitting a word.

    Martin

  • Fitz,

    Interestingly I took the actual notes for a dozen examples and created a query as union of these text fields :

    (select 'reviewing advisory' as Notes

    union all

    select 'review cc edits and send meeting summary' as Notes

    union all

    select 'meeting summary' as Notes

    union all

    select 'client mtg to discuss updates;' as Notes

    union all

    select 'review agenda and update on pending items;' as Notes

    union all

    select 'bi-weekly call' as Notes

    union all

    select 'review emails on Storytellers and FOX meeting;' as Notes

    union all

    select 'reading and filing emails' as Notes

    union all

    select 'reading and filing emails' as Notes

    union all

    select 'edited and inserted more NBI questions for questionnaire; review w/CLW; send to client;' as Notes

    union all

    select 'reading and filing emails' as Notes

    union all

    select 'conference call' as Notes

    union all

    select 'reading and filing emails' as Notes)

    and that did indeed wrap correctly. It fails when it's a basic select rtrim(Notes) as Notes from tablename.

    Can SSRS be treating these as different field types? Should I convert my char(255) field to some other field type in my stored procedure?

    Martin

  • OK if we do the same steps then we can investigate if the issue is setup or data.

    1) Add a new report in BIDS using Add New Item (not wizard)

    2) Add a data source to LOCAL - TempDB

    3) Add a data set as

    SELECT 'This is a long piece of text with spaces and a split-word with a hyphen' as TextValue

    4) Add a textbox to the report body and set the width = 4 cm

    5) When I run the report I see :

    This is a long piece of

    text with spaces and a

    split-word with a hyphen

    6) Changing the width to 4.2 cm I see

    This is a long piece of text

    with spaces and a split-

    word with a hyphen

    See how you get on.

    Fitz

  • Fitz,

    We were obviously typing at the same time! See my comments above. Yes your example would have worked correctly for me.

    Martin

  • Weird, it looks very much like my data. When I copy the notes from my table into a query in SSMS I'm getting something that looks like a red dash (-) between the words and not a space. So SSRS must be seeing it as one long string. Anyone ideas what this - character is? I should then be able to do a replace and everything should then be fine.

    Martin

  • Ok, I have replicated your erroneous output. Your spaces are not being seen a spaces if that makes sense. I changed the spaces in the example before by replacing the spaces for char(160) values. It looks the same but the textbox does not recognise it as a word terminator, so treats the string as one long word, therefore splits at the width of the textbox.

    I don't see how this could be in your field. Collation difference maybe?

    Could you try this in SSMS to see where the first space is in the notes field. If it shows 0 as a result then the spaces are not actually spaces.

    select charindex(' ',Notes,0) from NotesTable

    -- Edit

    Sorry overlapped again

    Fitz

  • It seems I have non-line breaking spaces instead of sensible, normal spaces which would of course stop the wrapping. Some strange unicode. I can replace char(160) with a normal space and all is fine.

    Thanks for you assitance Fitz.

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply