Controls not working after Export to Excel or Export to PDF

Add the following script to your webpart / custom control that need to have export and other controls functionals


So here you go with the working solution.

<script type="text/javascript" language="javascript">
    //sharepoint postback to work after clicking on export to excel button

    if (typeof (_spBodyOnLoadFunctionNames) != 'undefined' &&
                                           _spBodyOnLoadFunctionNames != null) {
        _spBodyOnLoadFunctionNames.push("supressSubmitWraper");
    }

    function supressSubmitWraper() {

        _spSuppressFormOnSubmitWrapper = true;

    }
</script>



Hope this will helps.

Reference :

Comments

Popular posts from this blog

This content database has a schema version which is not supported in this farm

Export all documents/Folders permissions to CSV using SharePoint PowerShell

SPUtility.js