March 27, 2018

"Unable to display this Web Part" sharepoint error with custom XSLT applied to list contains Large number of items

Introduction:
In this article we will explore, How to solve the SharePoint Web Part error “Unable to display this Web Part “while using custom XSL

PROBLEM:

"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: ae93579e-b40d-c07b-d97e-f14105eec10f"

Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.     at <xsl:apply-templates>(XmlQueryRuntime , XPathNavigator )     at <xsl:template match="dsQueryResponse">(XmlQueryRuntime , XPathNavigator )     at <xsl:apply-templates>(XmlQueryRuntime , XPathNavigator )     at Root(XmlQueryRuntime )     at Execute(XmlQueryRuntime )     at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.ApplyXslTransform(XPathNavigator dataNavigator, XslCompiledTransform xslCompiledTransform, XsltArgumentList xmlArguments)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.ExecuteTransform(XslCompiledTransform xslCompiledTran...          ae93579e-b40d-c07b-d97e-f14105eec10f 



WORKAROUND:

This happens because the time allocated for XSL transformation is lesser while loading large number of records in the page.

By default Sharepoint allocates 1 second for XSL transformation.


SOLUTION:

To solve this issue, we need to increase the timeout seconds in Sharepoint FARM for xsl transformation.

Open Sharepoint Management Shell with "Run as Administrator"

Steps:
=====
Check Current Setting
$farm = Get-SPFarm 
$farm.XsltTransformTimeOut

$farm = Get-SPFarm
$farm.XsltTransformTimeOut


The default setting is 1 second ,Now increase the timeout to 5 seconds as below. 
(increase timeout seconds based on your page loading time)


$farm = Get-SPFarm
$farm.XsltTransformTimeOut = 5
$farm.Update()


Now the issue fixed, refresh the page to view the list items.



Hope this article helps !!


Thanks for reading this article ! ! please leave your comments and suggestion about this article.


March 23, 2018

How to restore .MDF and .LDF Files in SQL Server

Itroduction:
In this article we will explore , How to restore .mdf and .ldf files in SQL server.


Recently i had an situation that my application database table records are deleted unexpectedly. Now  we need do restore the database from the backup files.

(usually we do back process for the database which will generate .mdf files and .ldf files.)

So now i have both the .mdf and .ldf files to restore /attach database.

STEP 1:

You can copy and paste both the files in to the appropriate folder that other sql db's are located. 

"C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA"

NOTE: This location will differ based on your SQL server installation.

Step 2:
Right click on database and Select Attach Database.



Step 3:
Click Add and choose the .mdf files from the pasted location and click ok .




Step 4:
Add the .mdf files and click ok .




Step 5:
Now the Database restored successfully as below.






Hope this article helps !!



Thanks for reading this article ! ! please leave your comments and suggestion about this article.

March 22, 2018

How to convert SharePoint Form Radio Buttons from Vertical to Horizontal with jQuery

Itroduction:
In this article we will explore , How to convert the sharepoint form Radio buttons from vertical to Horizontal mode.




Solution: 
Add the below jquery to script editor web part in the SharePoint form as below. 

"<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script language="javascript">

$(document).ready(function()
{
  var firstRadio = $(".ms-RadioText:eq(0)");
  $(".ms-RadioText:gt(0)").appendTo($(firstRadio));
});
</script>"

Now the  sharepoint form will looks like below



Hope this article helps !!



Thanks for reading this article ! ! please leave your comments and suggestion about this article.

January 9, 2018

How to solve the script editor error "ERR_BLOCKED_BY_XSS_AUDITOR" in sharepoint

Introduction:
In this article we will explore , How to solve the script editor error "ERR_BLOCKED_BY_XSS_AUDITOR" in SharePoint

After adding javascript to script editor web part in the SharePoint pages and  trying to edit the page we will get the error as below. 


Solution: 
We can disable this by adding the below custom header to the web.config file as below. 

<add name="X-XSS-Protection" value="0"/>  "

After adding code to the web.config file: 


Note: This workaround will work only on on-premises environment.


Hope this article helps !!



Thanks for reading this article ! ! please leave your comments and suggestion about this article.
  



January 8, 2018

How to hide the html elements in SharePoint popup dialogs

Introduction:
In this article we will explore , How to hide the html elements in SharePoint popup page.

By  default SharePoint allows to hide the elements from popup dialogs using css class.

When creating custom master pages , we will add own branding html elements like headers , logos and footers to the pages. 

These elements are not required to be shown while opening the popup dialogs.


Solution: 
simply add the below cssclass to the html  elements to hide in the dialog

"ms-dialogHidden"



<div id="header" class="ms-dialogHidden">

</div>

<div id="logo" class="ms-dialogHidden">

</div>

<div id="footer" class="ms-dialogHidden">

</div> 

Sample Code added: 


OutPut: 


Hope this article helps !!



Thanks for reading this article ! ! please leave your comments and suggestion about this article.