none
Getting error while adding field to data viewer web part

    Question

  • I have custom EditItemForm for a custom list having over 100 columns. That EditItemForm contains a DataFormWebPart in edit mode having over 100 <SharePoint:FormField controls.

     

    If I browse for the above page in internet explorer, I got got the generic error:

     

    "Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.


    Correlation ID:XXXXXXX"

     

    I went to Log, and got the exact error details as follows,

     

    "Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.     at Microsoft.Xslt.NativeMethod.CheckForSufficientStack()     at <xsl:template name="dvt_1.rowedit">(XmlQueryRuntime , XPathNavigator , Double , String )     at <xsl:template name="dvt_1.body">(XmlQueryRuntime , IList`1 , Double , Double )     at <xsl:template name="dvt_1">(XmlQueryRuntime , XPathNavigator )     at Root(XmlQueryRuntime )     at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)     at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)     at System.Xml.Xsl.XslCompiledTransform.Tr..."

     

    Then I thought of removing some columns from the dataFormWebpart. I removed several <SharePoint:FormField controls from the dataFormWebpart. Then page started working fine.

     

    Please let us know if there is any workaround to fix this issue.

     

    Note: The same page was working fine in MOSS 2007 before migrating to SharePoint 2010.
    Sharepoint Consultant from NY, USA
    Friday, October 22, 2010 2:41 PM

All replies

  • I have custom EditItemForm for a custom list having over 100 columns. That EditItemForm contains a DataFormWebPart in edit mode having over 100 <SharePoint:FormField controls.

     

    If I browse for the above page in internet explorer, I got got the generic error:

     

    "Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.


    Correlation ID:XXXXXXX"

     

    I went to Log, and got the exact error details as follows,

     

    "Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.     at Microsoft.Xslt.NativeMethod.CheckForSufficientStack()     at <xsl:template name="dvt_1.rowedit">(XmlQueryRuntime , XPathNavigator , Double , String )     at <xsl:template name="dvt_1.body">(XmlQueryRuntime , IList`1 , Double , Double )     at <xsl:template name="dvt_1">(XmlQueryRuntime , XPathNavigator )     at Root(XmlQueryRuntime )     at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)     at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)     at System.Xml.Xsl.XslCompiledTransform.Tr..."

     

    Then I thought of removing some columns from the dataFormWebpart. I removed several <SharePoint:FormField controls from the dataFormWebpart. Then page started working fine.

     

    Please let us know if there is any workaround to fix this issue.

     

    Note: The same page was working fine in MOSS 2007 before migrating to SharePoint 2010.
    Sharepoint Consultant from NY, USA

    I have the same problem!
    I have custom lists which has 108 used-defined columns.

    The default new/edit forms work OK, but when I create custom "New  Form" in SPD 2010 and trying to add new item to the list  got the following error:

    Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.


    and in the log:

    Error while executing web part: System.StackOverflowException: Operation caused a stack overflow. at Microsoft.Xslt.NativeMethod.CheckForSufficientStack() at <xsl:template name="dvt_1.rowedit">(XmlQueryRuntime , XPathNavigator , Double , Double ) at <xsl:template name="dvt_1.body">(XmlQueryRuntime , XPathNavigator , Double , IList`1 ) at <xsl:template name="dvt_1">(XmlQueryRuntime , XPathNavigator , Double ) at Root(XmlQueryRuntime ) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter) at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results) at Microsoft.SharePoint.WebPartPages.DataFormWebPart.ExecuteTransform(XslCompiledTransform xslCompiledTransform, XsltArgumentList xmlArguments, Boolean bDeferExecuteTransform) at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)

    reducing the number of field helps, but it's not an option for me :(

    Monday, October 25, 2010 7:50 AM
  • We are aware of a limitation using Custom Forms regarding the number of columns used.  The workaround at this point is to limit the number of columns if using a custom form.  We have found you can remove the <sharepoint:fielddescription control to help increase the number of fields on the web part before it errors out.

    This behavior is currently being investigated. 

    Regards,
    Jing Wang
    Microsoft Online Community Support

    Wednesday, November 24, 2010 4:44 PM
  • Hi there,

    I was wondering if anyone had any luck getting a hotfix for this bug yet? 

    Thanks

    Dominic

    Wednesday, December 29, 2010 1:22 AM
  • Hi..

    I am also facing the same issue SPBlogger has mentioned.. In my case .. I am trying to add a newly created column in the default edit list form and deploying them through a Module in Visual Studio.. Even a slightest  of change tends to bring out this error...

    Interestingly the New Form is not affected by this issue.

    Please help if anyone has found a solution..!!

     

    Regards,

    Rahul Vartak

    http://rahul-vartak.blogspot.com

     

     

     

    Tuesday, January 04, 2011 10:21 AM
  • I have this issue as well.  The problem bites at around 78 columns in the Edit form.  I've not tested further in the New form to find exactly where it hits there as well.  DispForm can have as many as I want.  I've got half a dozen sites or so that have lists with around 100 columns laid out in tabs or grids on custom forms.  As I see it none of them can upgrade with this bug. 
    Thursday, March 03, 2011 9:58 PM
  • I have to imagine wrapping these fields in different Ajax Panels would solve this problem - kind of split up the processing of the fields into different requests.
    Friday, March 04, 2011 12:14 AM
  • I am also experiencing the same issue. The new & display forms are working fine but the edit form does not work. I tried copying the default editform and adding a new webpart Zone with the editform web part for my list. This worked initially but as soon as I made a change to the form, even just adding a row, no new fields, the error returned.

    Has anyone found a solution?

    Thursday, April 14, 2011 1:42 AM
  • I am having the same issue.  I can't add any more than 80 columns.  Is there a fix for this?
    Thursday, May 12, 2011 7:20 PM
  • I'm facing the same problem - it occures in New and Edit Form :(

     

    Any solutions for that?

    Monday, June 06, 2011 8:39 AM
  • We, too, are experiencing the error in the ULS logs:

    Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.   
     at Microsoft.Xslt.NativeMethod.CheckForSufficientStack()

    Our custom New, Edit and Display forms worked fine with SharePoint 2010 Feb CU and then with SP1, but when the June CU and/or August CU was applied, we started getting this error.

     

    Thursday, September 08, 2011 5:00 PM
  • In SP1 and earlier, you could sometimes fix this by breaking the "dvt_1.rowedit" template into smaller templates and calling them sequentially. Sadly, this no longer works in many cases.

    Microsoft's "fix" for this problem appears in the August 2011 CU (Possibly earlier in the June CU - haven't checked that one). They have implemented a one-second timer that artificially throws a stack overflow exception if a transform takes longer than 1 second.

    Reflector shows us what's going on. As the stack trace shows, it's in Microsoft.Xslt.NativeMethod.CheckForSufficientStack().

    A dateTime variable has been set to Now + 1 second when a Microsoft.Xslt.NativeMethod.SetStackBarrier() method was called, then we have this gem:

    public static unsafe void CheckForSufficientStack()
    {
        void* stackBarrier = StackBarrier;
        if (dateTime < DateTime.Now)
        {
            throw new StackOverflowException();
        }
        if (&stackBarrier < stackBarrier)
        {
            throw new StackOverflowException();
        }
    } 

    As you can see, there has been no real stack overflow, and there isn't even any provision for allowing a SharePoint admin to adjust the now-plus-one-second hack.

    The MSFT support person we spoke with said this code was added in the August CU to "prevent long transforms from bringing down the server." So... Let's see what the SP1 version of the same method looks like:

    public static unsafe void CheckForSufficientStack()
    {
        void* stackBarrier = StackBarrier;
        if (((++callCount & 0xffff) == 0) && (dateTime.AddSeconds(5.0) < DateTime.Now))
        {
            throw new StackOverflowException();
        }
        if (&stackBarrier < stackBarrier)
        {
            throw new StackOverflowException();
        }
    }
    


    Well, at least it allowed 5 seconds instead of 1....



    • Edited by Dan Davis Wednesday, September 21, 2011 5:40 AM
    Monday, September 19, 2011 8:47 PM
  • Is it possible that the 5 second fix was part of June CU but not SP1? We started getting these errors after installing SP1 but have not installed the June CU.


    Doug Hemminger http://www.sharepointdoug.com
    Friday, October 07, 2011 9:19 PM
  • We have a List with very much columns too and where getting the same error when opening items.

    I think i found a good workaround for our environment:
    Because not every list-item has all columns filled i created custom forms with SharePoint-Designer that hide empty columns automatically.
    When you now open a list-item it only shows the columns containing information and I havent seen this error since I added the custom forms.
    Of course this only helps when you don't have all columns filled in all list-items, but maybe I could help some of you!

    Friday, October 21, 2011 6:38 AM
  • UPDATE: The best way to work around this issue is the following:

    Microsoft has released february 2012 CU for SharePoint: http://support.microsoft.com/default.aspx?scid=kb;EN-US;2597150 where it it possible to modify the XSL tranformation timeout by using Powershell. This will fix the issue as the original timeout was hardcoded to 1 second. After installing the CU, you are able to do the following by using PowerShell:

    $farm = Get-SPFarm 
    $farm.XsltTransformTimeOut = 5 //timeout in seconds 
    $farm.Update() 
    

    • Edited by Kjaps Tuesday, June 26, 2012 6:37 AM better answer
    Friday, April 20, 2012 2:18 PM