Sharepoint Calculated Column string;# - InfoPath Dev
in

InfoPath Dev

Sharepoint Calculated Column string;#

Last post 04-21-2011 02:03 AM by extreme79. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-24-2011 01:59 AM

    Sharepoint Calculated Column string;#

     Can anyone help please. I can't seem to find a slution that fixes the following problem -

    When using a calculated column in a sharepoint list to concatonate 2 fields, for instance =[Column1]&" - "[Column2]  returns something like ows_DESC="string;#Full Time - Writing up - previously full-time"

    The problem here is the string;#. I'm using this to populate a dropdown list in InfoPath via a data connection. Does anyone know how to remove this? It's driving me mad. I thought I'd crakced it using a suggestion from the comments in this blog http://blogs.msdn.com/b/infopath/archive/2007/01/15/populating-form-data-from-sharepoint-list-views.aspx?PageIndex=2 which modifies the xsl view using the substring function. However this guide is for 2010 and I'm using 2007 and it seems to break the form. Preview/publish etc stops working.

    Can anyone help. Either with parsing out the string;# or is there way around using a calcculated column? Can I some how concatonate the 2 columns and show this in a dropdown as the Description using an Infopath trick?

     

  • 03-03-2011 12:52 AM In reply to

    Re: Sharepoint Calculated Column string;#

    It seems that the only way to get around this is to modify the xsl for the view and use the substring method (other than creating a feature or workflow to concatenate 2 columns in a column which isn't of type calculated column)

     The only problem with the substring method is that I get the following error:

    The SOAP response indicates that an error occurred on the server:

    Server was unable to process request. ---> Value cannot be null.

    Parameter name: key

     

    The section of the stylesheet with the substring function added is:

     <tr style="MIN-HEIGHT: 26px">
                 <td style="BORDER-RIGHT: #969696 1pt solid; PADDING-RIGHT: 1px; BORDER-TOP: #969696 1pt solid; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; BORDER-LEFT: #969696 1pt solid; PADDING-TOP: 1px; BORDER-BOTTOM: #969696 1pt solid; BACKGROUND-COLOR: #ebf0f9">
                  <div>
                   <font size="2">
                    <strong>19.</strong>
                   </font>
                  </div>
                 </td>
                 <td style="BORDER-RIGHT: #969696 1pt solid; PADDING-RIGHT: 5px; BORDER-TOP: #969696 1pt solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; BORDER-LEFT: #969696 1pt solid; PADDING-TOP: 1px; BORDER-BOTTOM: #969696 1pt solid; BACKGROUND-COLOR: #cbd8eb">
                  <div>
                   <font size="2">Default Regulation</font>
                  </div>
                 </td>
                 <td style="BORDER-RIGHT: #969696 1pt solid; PADDING-RIGHT: 1px; BORDER-TOP: #969696 1pt solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: middle; BORDER-LEFT: #969696 1pt solid; PADDING-TOP: 1px; BORDER-BOTTOM: #969696 1pt solid; BACKGROUND-COLOR: #f2f2f2">
                  <div>
                   <font color="#ff0000">
                    <select class="xdComboBox xdBehavior_Select" title="" style="WIDTH: 412px" size="1" xd:CtrlId="CTRL416" xd:xctname="dropdown" xd:binding="my:Stage1/my:part19/my:p19defaultRegulation" xd:boundProp="value" value="" tabIndex="0">
                     <xsl:attribute name="value">
                      <xsl:value-of select="my:Stage1/my:part19/my:p19defaultRegulation"/>
                     </xsl:attribute>
                     <xsl:choose>
                      <xsl:when test="function-available('xdXDocument:GetDOM')">
                       <option/>
                       <xsl:variable name="val" select="my:Stage1/my:part19/my:p19defaultRegulation"/>
                       <xsl:if test="not(my:Data_Connections/my:RegulationGroup[my:REGULATION=$val] or $val='')">
                        <option selected="selected">
                         <xsl:attribute name="value">
                          <xsl:value-of select="$val"/>
                         </xsl:attribute>
                         <xsl:value-of select="$val"/>
                        </option>
                       </xsl:if>
                       <xsl:variable name="items">
                        <xsl:copy-of select="my:Data_Connections/my:RegulationGroup"/>
                       </xsl:variable>
                       <xsl:variable name="uniqueItems" select="msxsl:node-set($items)/*[not(my:REG_CODE_AND_DESC = preceding::my:RegulationGroup/my:REG_CODE_AND_DESC)]"/>
                       <xsl:for-each select="$uniqueItems">
                        <option>
                         <xsl:attribute name="value">
                          <xsl:value-of select="my:REGULATION"/>
                         </xsl:attribute>
                         <xsl:if test="$val=my:REGULATION">
                          <xsl:attribute name="selected">selected</xsl:attribute>
                         </xsl:if>
                         <xsl:value-of select="substring(my:REG_CODE_AND_DESC, 9)"/>
                        </option>
                       </xsl:for-each>
                      </xsl:when>
                      <xsl:otherwise>
                       <option>
                        <xsl:value-of select="my:Stage1/my:part19/my:p19defaultRegulation"/>
                       </option>
                      </xsl:otherwise>
                     </xsl:choose>
                    </select>
                   </font>
                  </div>
                 </td>
                </tr>

    Has anybody else had this problem and if so, how have you worked around it? Getting desperate on this one now!

  • 04-21-2011 02:03 AM In reply to

    Re: Sharepoint Calculated Column string;#

    Same problem here :(

     I'm actually fighting against this damn "string;#" !

    Infopath 2007 + sharepoint xml from sharepoint (with a calculated field).

    From infopath, no way to strip off this fu*king "string;#" from my combo's items; manual editing of my form cause error's (infopath and form services).
    I've checked many times the syntax but I'm 100% sure that ther's no errors.. but no way!

    we need an help :(

     

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