HTML tags and Rich Text Box control - InfoPath Dev
in

InfoPath Dev

HTML tags and Rich Text Box control

Last post 10-25-2012 03:55 PM by Kelly Anderson. 15 replies.
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts: Previous Next
  • 10-24-2012 04:35 PM

    HTML tags and Rich Text Box control

    Hi,

    Does qRules have a command I can use to render HTML tags as HTML and not as plain text in a Rich Text Box control and not print the tags as a plain text?

    Thanks.

    Kelly

    Filed under: ,
  • 10-24-2012 04:41 PM In reply to

    Re: HTML tags and Rich Text Box control

    I'm wondering if CopyRichText might do this - is the HTML in a secondary data source?
    Hilary Stoupa

  • 10-24-2012 04:48 PM In reply to

    Re: HTML tags and Rich Text Box control

    yes, the html is in a secondary data source (sharepoint list)

    I have a rich text box (xhtml data type) in my form which using qrules saves to a sharepoint list (multiple lines of text column). using the mapping tool, i ticked rich text so it saves correctly to my sharepoint list. that all works well. now, i'm trying to display the multiple lines of text column in my sharepoint list to another infopath form with a xthml data type.  it prints the html tags as plain text. i've tried copyrichtext command, but it seems to do nothing.

    thanks.

    Kelly

  • 10-24-2012 04:58 PM In reply to

    Re: HTML tags and Rich Text Box control

    What version of InfoPath / SharePoint?

    Hilary Stoupa

  • 10-24-2012 04:59 PM In reply to

    Re: HTML tags and Rich Text Box control

    Infopath 2010, Sharepoint 2010, qRules 4.2
  • 10-24-2012 05:03 PM In reply to

    Re: HTML tags and Rich Text Box control

    I just tried this, and CopyRichText worked for me. I circled my original SharePoint data in blue, and the field I copied to in pink. In your form, does your SharePoint data show up as rich text? Mine does....
    Hilary Stoupa

  • 10-24-2012 05:11 PM In reply to

    Re: HTML tags and Rich Text Box control

    yes, my Sharepoint data shows up as rich text. 

    steps I did:

    1. queried the Sharepoint list (CommentList)

    2. sets my infopath rich text field (rtxtComment1) to the sharepoint multi line text column (Comment)

    3. sets another infopath rich text field (rtxtComment2) to CopyRichText /xpathsrc=/my:myFields/my:rtxtComment1 /xpathdest=/my:myFields/my:txtComment2

    it's still displaying the tags as plain text...

    thanks.

  • 10-24-2012 05:18 PM In reply to

    Re: HTML tags and Rich Text Box control

    I think you would want to use copy rich text to copy the SharePoint RT into your IP field. So, your command would use the /dsnamesrc param with the name of your SharePoint list connection, and the /xpathsrc would be the path to your SharePoint rich text field. I imagine that InfoPath is horking up the rich text when it copies it with your rule in item 2, there, and qRules isn't set up to rescue it at that point. :)

    Hilary Stoupa

  • 10-24-2012 05:28 PM In reply to

    Re: HTML tags and Rich Text Box control

    I'm doing what you suggested by using this command:

    Set Field: Command    Value: CopyRichText /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Comment /dsnamesrc=CommentList /xpathdest=/my:myFields/my:rtxtComments

    result of rtxtComments:

    <div class="ExternalClassE20D9C7792664880825F51687D5F4960"><p class="ExternalClass77B622EBEAD34E9AB57748F19DF6F558">blah</p> <p class="ExternalClass77B622EBEAD34E9AB57748F19DF6F558">blah</p> <p class="ExternalClass77B622EBEAD34E9AB57748F19DF6F558">blah blah blah</p> <div class="ExternalClass77B622EBEAD34E9AB57748F19DF6F558"> </div></div>

     What am I doing wrong?

  • 10-24-2012 05:54 PM In reply to

    Re: HTML tags and Rich Text Box control

    Finally got it working. I had to change the name of my secondary source.  It was too similar to the name of the source field.
  • 10-24-2012 06:40 PM In reply to

    Re: HTML tags and Rich Text Box control

    I don't understand why you had to change the name of your secondary data source - were you getting an error in the Qdabra Rules Error node? At any rate, glad you have it working!
    Hilary Stoupa

  • 10-24-2012 07:15 PM In reply to

    Re: HTML tags and Rich Text Box control

    I wasn't getting an error. My Sharepoint List name is Comment and the sharepoint rich text field is Comment as well.  Might be causing confusion... Maybe.

    Is it possible to use the CopyRichText command in a repeating table?  I am using a row counter to display it -> SharePointListItem_RW[number(varRowNumber)]/Comment.  Can I incorporate CopyRichText command to it?  If so, how?

     Thanks.

  • 10-25-2012 08:27 AM In reply to

    Re: HTML tags and Rich Text Box control

    The code in qRules uses the /dsnamesrc parameter to find the data source and the /xpathsrc parameter to get the node. However, if you believe you have found a bug, please let me know the exact steps so I can try to reproduce it, including the command syntax you used.

    You can use a concat statement to modify your command. So, click the fx button and use a formula like:

    concat("CopyRichText /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[", varRowNumber, "]/d:Comment /dsnamesrc=CommentList /xpathdest=/my:myFields/my:rtxtComments")

    Hilary Stoupa

  • 10-25-2012 03:35 PM In reply to

    Re: HTML tags and Rich Text Box control

    I used the following command, but it's only displaying the last record...

     concat("CopyRichText /dsnamesrc=CommentList /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[number(", varRowNumber, ")]/d:Comment /xpathdest=/my:myFields/my:grpCategory/my:grpCatComment/my:grpComment/my:txtComment")

    Help please.

    Thanks.

  • 10-25-2012 03:48 PM In reply to

    Re: HTML tags and Rich Text Box control

    I have no idea what "varRowNumber"s value is. I also don't know what "displaying the last record" means - I think of display as having to do with formatting, and you are trying to populate values.... But, I will take a guess. I'm guessing that your main data source field is also repeating.

    In that case, you may need to put the rule on the repeating group that contains the txtComment field, so that the rule will fire the appropriate number of times. Or, if you are incrementing varRowNumber, you could put the rule on that....

    And you need to also have an index on the repeating group in the /xpathsrc.

    concat("CopyRichText /dsnamesrc=CommentList /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[number(", varRowNumber, ")]/d:Comment /xpathdest=/my:myFields/my:grpCategory/my:grpCatComment/my:grpComment[number(", varRowNumber, ")]/my:txtComment")

    For example. Of course, I'm guessing that my:grpComment is your repeating group, but it could be any of the other fields. In fact, you may have nested repeating data here - which is more complex.

    Hilary Stoupa

Page 1 of 2 (16 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.