locked
formatting a text box with html RRS feed

  • Question

  • hi we run 2016 enterprise.  i once saw an ssrs textbox setting (I think) where the line feeds etc are controlled with html tags rather than carriage control. 

    Can someone provide a link or clarification on the subject?  I'm looking too.

    if we do go that route, can a text box expand to accommodate an unknown height of html controlled data?  what if the text box goes onto the next page? 

    finally would line feeds in the column be just as good?  I think line feeds are 0x15.  its just as easy for us to go either way.  its been a while but if memory serves, one option is worse perhaps if the report is saved to word etrc.

    Friday, August 7, 2020 4:08 PM

Answers

  • You can add a CHAR(10) in the data coming from the query to get new lines in a normal text box.  The text box can then be set to grow and it will grow as large as needed to accommodate the data.

    If the only formatting you need from HTML is a new line - then I would just add the char(10) values in SQL.

    You can also just set the text box so that it grows and the data will wrap.


    Jeff Williams

    • Marked as answer by db042190 Wednesday, August 12, 2020 10:16 AM
    Monday, August 10, 2020 4:19 PM
  • I guess you mean the placeholder function in SSRS: Format Text in a Text Box (Report Builder and SSRS)

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    • Marked as answer by db042190 Wednesday, August 12, 2020 10:17 AM
    Friday, August 7, 2020 4:23 PM
  • As Olaf said, it is the placeholder function in SSRS.

    You could also refer this documentation:

    https://docs.microsoft.com/en-us/sql/reporting-services/report-design/importing-html-into-a-report-report-builder-and-ssrs?view=sql-server-ver15

    And you are concerned about a person gets the html delimiters.

    It is mentioned in the article:

    When you import text that contains HTML markup, the data must always be parsed by the text box first. Because only a subset of HTML tags is supported, the HTML that is shown in the rendered report may differ from your original HTML.

    You could also set the properties of the placeholder.

    Regards,

    Zoe


    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    • Marked as answer by db042190 Wednesday, August 12, 2020 10:17 AM
    Monday, August 10, 2020 8:51 AM

All replies

  • I guess you mean the placeholder function in SSRS: Format Text in a Text Box (Report Builder and SSRS)

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    • Marked as answer by db042190 Wednesday, August 12, 2020 10:17 AM
    Friday, August 7, 2020 4:23 PM
  • i think thats it , thx.  according to that article even saving to things like pdf arent an issue.  but they only mention pdf.

    do you or the community recall if the issue is when a person hilights and saves that he/she gets the html delimeters, usually being an undesirable side effect?

    I think there is something bad about going the html route.  

    Friday, August 7, 2020 4:39 PM
  • i'm thinking out loud that one drawback is that id never be allowed to have left and right angle brackets in the text for any reason other than html control.  that could be a big problem.
    Friday, August 7, 2020 5:07 PM
  • As Olaf said, it is the placeholder function in SSRS.

    You could also refer this documentation:

    https://docs.microsoft.com/en-us/sql/reporting-services/report-design/importing-html-into-a-report-report-builder-and-ssrs?view=sql-server-ver15

    And you are concerned about a person gets the html delimiters.

    It is mentioned in the article:

    When you import text that contains HTML markup, the data must always be parsed by the text box first. Because only a subset of HTML tags is supported, the HTML that is shown in the rendered report may differ from your original HTML.

    You could also set the properties of the placeholder.

    Regards,

    Zoe


    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    • Marked as answer by db042190 Wednesday, August 12, 2020 10:17 AM
    Monday, August 10, 2020 8:51 AM
  • You can add a CHAR(10) in the data coming from the query to get new lines in a normal text box.  The text box can then be set to grow and it will grow as large as needed to accommodate the data.

    If the only formatting you need from HTML is a new line - then I would just add the char(10) values in SQL.

    You can also just set the text box so that it grows and the data will wrap.


    Jeff Williams

    • Marked as answer by db042190 Wednesday, August 12, 2020 10:16 AM
    Monday, August 10, 2020 4:19 PM