Line break - InfoPath Dev Sign in | Join | Help in General InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » General » Line break Line break Last post 01-15-2015 02:08 PM by lockettc. 29 replies. Page 2 of 2 (30 items) < Previous 1 2 Sort Posts: Oldest to newest Newest to oldest Previous Next 05-06-2009 09:08 AM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact By any chance are those fields in a repeating field of some sort, or are they all separate fields throughout the data source. Could you post your formula in its current form? When you added the XML file, did you leave the option "Embed this as a resource file" or something like that checked, or did you uncheck it? It's a good idea to have the file stored as a resource. Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 05-06-2009 12:01 PM In reply to richardlpalmer Joined on 03-26-2009 Kirkland, WA Posts 31 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact Jimmy: By any chance are those fields in a repeating field of some sort, or are they all separate fields throughout the data source. Could you post your formula in its current form? When you added the XML file, did you leave the option "Embed this as a resource file" or something like that checked, or did you uncheck it? It's a good idea to have the file stored as a resource. It's in a Repeating Section, yes. I currently have it bound to a Main data source (going to change that). Here's the formula: concat(@RelDateA, newLine, @RelDateB, newLine, @RelDateC, newLine, @RelDateD, newLine, @RelDateE, newLine, @RelDateF, newLine, @RelDateG, newLine, @RelDateH, newLine, @RelDateJ, newLine, @RelDateK, newLine, @RelDateL, newLine, @RelDateM, newLine, @RelDateN, newLine, @RelDateO, newLine, @RelDateP, newLine, @RelDateQ, newLine, @RelDateR, newLine, @RelDateS, newLine, @RelDateT, newLine, @RelDateU) When I added the XML file, yes I left that option checked (seemed logical to me). 07-08-2009 05:54 AM In reply to andem038 Joined on 07-08-2009 Posts 1 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact Hi, I have a similiar problem. I'm trying to use Show Dialog box expression with a SP-list. My column in SP is type: Multiple lines of text (Plain text). In that column I have text with line breaks, but in dialog box I get a non-line-break-text. Any solution? 10-07-2009 04:44 AM In reply to Svetoslav Joined on 01-29-2009 Posts 51 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact Hi, I have the exactly the same problem. I have a data connection to SP library with forms. In this SP library I have exported a rich text field of the form, which contains some text. In the main form with a data connection I am pulling this text into a repeating table (with some conditional formating i filter all the files in the SP library and take exactly what i need) So in the main form, where I have the extracted text, it is not formated with paragraphs..it is very bothering. It is strange because even when they are extracted into the SP library I do see the paragraphs.. If someone can give me a hint, I will be very thankful 10-22-2010 10:33 AM In reply to Inder Joined on 10-22-2010 Posts 1 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact hi did you find a solution to this, I want user to enter data and copy paste from word but when there are line breaks, once i save and close the form and try to reopen it gives and error and the form type changes to simple XML . I have is a browser compatible form deployed on sharepoint 2007 and i am aware of the limitation that richtext does nto supoport all the properties Thanks in advance 12-14-2010 04:45 AM In reply to merlin Joined on 05-09-2010 Posts 14 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact Jimmy, chasing threads here. How can i apply this to adding ascii charactors to a concat statement? please clarify. thanks 11-23-2011 09:29 AM In reply to Scott Rooke Joined on 09-10-2011 Chicago, IL Posts 55 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact Hi Jimmy - I tried using the newline from the xml 2DS file but it's not working in InfoPath 2007 Browser Enabled Forms. It does work when I preview it using InfoPath 2010 Designer. My XML looks like this. <?xml version="1.0"?><linebreaks> <newLine>
</newLine></linebreaks> Any thoughts why this won't work in the browser? Thanks! Scott 11-23-2011 09:34 AM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact Hi Scott, I hate to be the bringer of bad news, but everything I've heard about this method is that it doesn't work in the browser. I've yet to hear of any approach that does. Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 11-23-2011 09:52 AM In reply to Scott Rooke Joined on 09-10-2011 Chicago, IL Posts 55 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact Oh.... say it ain't so! ARGH!!!! Well, let me explain what I'm trying to do and maybe there's another approach. I have a multi-line textbox field on my form. I have a history multi-line textbox field (read-only) as well. That if the Status field is not blank then concat the current History value with the new value in the Status field. If I manually put a carriage return before I start typing in the Status field and one at the end then it works. But that's a major training predicament. Any thoughts? Thanks! Scott BTW - I loved the comment from the other day, "We don't write code for FREE." Was that you? 11-23-2011 10:45 AM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact Hi Scott, Yeah, that was my comment from the other day. :-) Now that I'm searching through old forum posts, I can't find any strong evidence that this trick doesn't work on browsers, so I may have been mistaken there. One thing you can try first is to use 
 or 

 instead of just 
 If that still doesn't work, the more orthodox way of maintaining status changes, and what we do, is to use a repeating field or a repeating group, and add a new row to it when the status changes. With qRules, that should be pretty easy to automate. Would that work for you? Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 11-28-2011 11:58 AM In reply to Scott Rooke Joined on 09-10-2011 Chicago, IL Posts 55 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact Thank Jimmy. No luck. I have used qRules with another client but it's not in the budget at the moment. I have mentioned it though and it will be considered for next years budget. For the time being, if the user enters a carriage return after adding their comments this will work. :-) 01-15-2013 08:14 AM In reply to danlovejoy Joined on 12-18-2012 Posts 11 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact This is a fascinating technique. Now, If I want to count the number of line breaks in a field, would I use XPath to match 
? 01-15-2013 11:14 AM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact Yes, you should be able to use the following formula to count the number of line breaks in a field:string-length(field) - string-length(translate(field, lineBreak, "")) Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 12-18-2014 01:19 PM In reply to wals5751 Joined on 03-25-2013 Posts 4 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact Perfect worked first time for me as per your instructions Used it as part of the solution to grab all the selected values of a multi select list box. First I used the solution in the link below to grab all the values , however it brought back one long string separated with semi colons https://social.technet.microsoft.com/Forums/office/en-US/021f0b84-08df-41f2-8cca-d3a8eb2e6ccd/how-to-get-the-selected-value-from-the-multipleselection-listbox-infopath-form?forum=sharepointadminprevious Then I used your solution to add the line returns to make it more presentable to the users in a multi line field. Many thanks 01-15-2015 02:08 PM In reply to lockettc Joined on 07-24-2013 Posts 5 Re: Line break Mark as Not AnswerMark as Answer... Reply Contact Hi Jimmy.. can you let me know what the trickier option is? Page 2 of 2 (30 items) < Previous 1 2 Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
By any chance are those fields in a repeating field of some sort, or are they all separate fields throughout the data source. Could you post your formula in its current form?
When you added the XML file, did you leave the option "Embed this as a resource file" or something like that checked, or did you uncheck it? It's a good idea to have the file stored as a resource.
Jimmy: By any chance are those fields in a repeating field of some sort, or are they all separate fields throughout the data source. Could you post your formula in its current form? When you added the XML file, did you leave the option "Embed this as a resource file" or something like that checked, or did you uncheck it? It's a good idea to have the file stored as a resource.
It's in a Repeating Section, yes. I currently have it bound to a Main data source (going to change that).
Here's the formula:
concat(@RelDateA, newLine, @RelDateB, newLine, @RelDateC, newLine, @RelDateD, newLine, @RelDateE, newLine, @RelDateF, newLine, @RelDateG, newLine, @RelDateH, newLine, @RelDateJ, newLine, @RelDateK, newLine, @RelDateL, newLine, @RelDateM, newLine, @RelDateN, newLine, @RelDateO, newLine, @RelDateP, newLine, @RelDateQ, newLine, @RelDateR, newLine, @RelDateS, newLine, @RelDateT, newLine, @RelDateU)
When I added the XML file, yes I left that option checked (seemed logical to me).
Hi,
I have a similiar problem.
I'm trying to use Show Dialog box expression with a SP-list. My column in SP is type: Multiple lines of text (Plain text). In that column I have text with line breaks, but in dialog box I get a non-line-break-text.
Any solution?
I have the exactly the same problem. I have a data connection to SP library with forms. In this SP library I have exported a rich text field of the form, which contains some text. In the main form with a data connection I am pulling this text into a repeating table (with some conditional formating i filter all the files in the SP library and take exactly what i need) So in the main form, where I have the extracted text, it is not formated with paragraphs..it is very bothering. It is strange because even when they are extracted into the SP library I do see the paragraphs..
If someone can give me a hint, I will be very thankful
hi
did you find a solution to this,
I want user to enter data and copy paste from word but when there are line breaks, once i save and close the form and try to reopen it gives and error and the form type changes to simple XML .
I have is a browser compatible form deployed on sharepoint 2007 and i am aware of the limitation that richtext does nto supoport all the properties
Thanks in advance
Jimmy, chasing threads here. How can i apply this to adding ascii charactors to a concat statement? please clarify.
thanks
Hi Jimmy -
I tried using the newline from the xml 2DS file but it's not working in InfoPath 2007 Browser Enabled Forms. It does work when I preview it using InfoPath 2010 Designer.
My XML looks like this.
<?xml version="1.0"?><linebreaks> <newLine>
</newLine></linebreaks>
Any thoughts why this won't work in the browser?
Thanks!
Scott
Hi Scott,
I hate to be the bringer of bad news, but everything I've heard about this method is that it doesn't work in the browser. I've yet to hear of any approach that does.
Oh.... say it ain't so! ARGH!!!!
Well, let me explain what I'm trying to do and maybe there's another approach. I have a multi-line textbox field on my form. I have a history multi-line textbox field (read-only) as well. That if the Status field is not blank then concat the current History value with the new value in the Status field. If I manually put a carriage return before I start typing in the Status field and one at the end then it works. But that's a major training predicament.
Any thoughts?
BTW - I loved the comment from the other day, "We don't write code for FREE." Was that you?
Yeah, that was my comment from the other day. :-)
Now that I'm searching through old forum posts, I can't find any strong evidence that this trick doesn't work on browsers, so I may have been mistaken there. One thing you can try first is to use 
 or 

 instead of just 

If that still doesn't work, the more orthodox way of maintaining status changes, and what we do, is to use a repeating field or a repeating group, and add a new row to it when the status changes. With qRules, that should be pretty easy to automate. Would that work for you?
Thank Jimmy. No luck. I have used qRules with another client but it's not in the budget at the moment. I have mentioned it though and it will be considered for next years budget. For the time being, if the user enters a carriage return after adding their comments this will work. :-)
Yes, you should be able to use the following formula to count the number of line breaks in a field:
string-length(field) - string-length(translate(field, lineBreak, ""))
Hi Jimmy.. can you let me know what the trickier option is?