locked
microsoft sql report builder - html and plain text functionality RRS feed

  • Question

  • I use the report services to generate quotes.  It does sometimes happen that markups needs to be added for eg. displaying only a certain word in bold, which  I am able to achieve by setting the Placeholder on the report to handle tags as HTML.  

    My problem:  I am using multiline textboxes on my crm web form.  When I add multiple lines of text with line feeds it is displayed correctly on the report when using plain text.  When I use HTML, I need to add a <br/> tag for every line feed.

    Is it possible to handle markup codes, but still handle the line spaces without the <br/> tag?

     

    Christo Vermeulen


    Monday, October 20, 2014 12:36 PM

Answers

  • Hi Christo,

     Thank you for taking time to explain the situation. I have a solution for you.

    Pic1.1 - the data used to populate a multiline text box.

    pic 1.2 - the actual result when data is shown with html and revised html formatting.

    Pic 2. the actual expression used to change the carriage returns into a html tag in report. the trick is that the replace with BR needs to happen before the data reaches html formatted textbox.

    HTH, Let me know if you have any questions.

    Regards,

    Jithesh

    Tuesday, October 21, 2014 10:39 AM

All replies

  • hi Christo,

    there is an option for text boxes, placeholder to Interpret HTML tags as styles. You can use this feature.

    http://msdn.microsoft.com/en-us/library/dd207057.aspx

    let me know if you are not able to find this option.

    regards

    Jithesh

    Monday, October 20, 2014 11:47 PM
  • HI Jithesh.  Thank you for the response.  However, as stated in my I know how to use the future to interpret HTML tags.  My problem is that once HTML is applied I need to add the <br/> tag for each new line.  For example:

    The input text is as follow:

    <font color = "red">Hello<font>
    World

    When it is read as plain text the result is:
    <font color = "red">Hello<font>
    World

    With HTML encoding the result is:

    HelloWorld

    The result that I require is:

    Hello
    World

    I want to be achieve this result without using the <br/> tag.  Do have any ideas?


    Christo Vermeulen


    Tuesday, October 21, 2014 7:08 AM
  • for that you could use expression - no html tags involved. Use

    VbCrLf

    for inserting a carriage return and a linefeed into the expression. This will be interpreted as a new line.

    for this , you do not have to select the radio button to apply styles as html.

    the value of text box will be ="Hello" + vbCrLf + "World"

    regards

    Jithesh

    Tuesday, October 21, 2014 7:32 AM
  • other options are

    vbCr - carriage returns or chr(10)

    vbLf - line feed or chr(13)

    the number in parentheses being the ascii.

    regards

    Jithesh

    Tuesday, October 21, 2014 7:42 AM
  • So there is no way to keep the line feeds and carriage return from plain text when using HTML?

    Christo Vermeulen

    Tuesday, October 21, 2014 7:53 AM
  • hello Christo,

    what you are looking for is a combination of html styles and text formatting. You could use your entire content of text area into a formatted string and apply specific text formatting. Eg.

    ="<font color = 'red'>Hello<font>" + vbCrLf + "World"

    but I am not sure if you want to go there.please let us know why you are against using <br> tag so that I can tell what I know.

    Tuesday, October 21, 2014 8:05 AM
  • I do not want to place the burden on sales people to type <br/> for each new line.  It will mostly be the sales people who enter the data into the text boxes.  They almost always add more than one line of text.  I cannot expect the sales people to type <br/> for each line break as they do not have html knowledge and it will only frustrate them.  It does rarely happen from time to time that they want to apply some formatting to the text for example make one word bold.  If they only kneed to apply the html tags at those times it will be fine.

    This image is what the text box looks like on the QuoteProduct Form.

    Item Description

    This is what the quote looks like.  Currently there is no extra functionality to format text:

    Quote


    Christo Vermeulen

    Tuesday, October 21, 2014 8:42 AM
  • Hi Christo,

     Thank you for taking time to explain the situation. I have a solution for you.

    Pic1.1 - the data used to populate a multiline text box.

    pic 1.2 - the actual result when data is shown with html and revised html formatting.

    Pic 2. the actual expression used to change the carriage returns into a html tag in report. the trick is that the replace with BR needs to happen before the data reaches html formatted textbox.

    HTH, Let me know if you have any questions.

    Regards,

    Jithesh

    Tuesday, October 21, 2014 10:39 AM