Thursday, March 24, 2016

SharePoint -Export List to Excel from Custom Link

 Steps to export ( excel ) list view from custom hyper link or button or JavaScript.

 1.  Add regular hyperlink href or button or java script function and look for the onclick event

2.  Update the  href/url part to the below given pattern
<server URL>/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=<List ID>&View=<View ID>
You can get the List ID or View ID  when you modify a view or from list setting page

3. Save and start exporting a view directly instead of ribbon command!


Happy Browsing!
Relax..

Tuesday, November 17, 2015

SharePoint - To Play Video from Video Library with carousel

Include this below scripts and update the video library as required in a content editor webpart.

<script type="text/javascript">
    function ShowPlayer(PlayerId) {
        var elm = document.getElementById(PlayerId);
        elm.style.display = 'block';
    }
    function HidePlayer(PlayerId) {
        var elm = document.getElementById(PlayerId);
        elm.style.display = 'none';
    }
  </script>

<div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div style="width:176px;height:104px;background-image:url('/film1.jpg');
                cursor:hand;"
                onclick="ShowPlayer('divp');
                playerp.controls.Play()" >
                <div id="divp" style="display:none;">
                <object classid='objPlayerID'
                id='playerp'
                width='174'
                height='104'
                standby='Please wait while the video is loaded...'>
                <param name='url' value='/film1.wmv' />
                <param name='src' value='/film1.wmv' />
                <param name='TransparentAtStart' value='0' />
                <param name='AutoStart' value='0' />
                <param name='CurrentMarker' value='0' />
                <param name='Balance' value='0' />
                <param name='CurrentPosition' value='0' />
                <param name='showcontrols' value='false' />
                <param name='enablecontextmenu' value='false' />
                <param name='fullscreen' value='False' />
                <param name='mute' value='false' />
                <param name='PlayCount' value='1' />
                <param name='rate' value='1.0' />
                <param name='uimode' value='none' />
                <param name='volume' value='100' />
                <embed type='application/x-mplayer2'
                pluginspace = 'http://www.microsoft.com/Windows/MediaPlayer/'
                name='playerp' ShowStatusBar='0' EnableContextMenu='0' autostart='0'
                width = '174' height = '129' loop='false'
                transparentatstart='true' src='/film1.wmv' />
                </object>
               
                </div>
        </div>

        <div style="text-align:left;">
                <img alt="" src=" /video_play.gif "
                title="Play" style="width: 82px;cursor:hand;height: 17px;padding-top:5px;"
                onclick="ShowPlayer('divp');playerp.controls.Play()" />
                <img alt="" src="/stop.png "
                title="Stop" style="width: 23px;cursor:hand;height: 17px;padding-top:5px;"
                onclick="HidePlayer('divp');playerp.controls.pause()";playerp.controls.stop(); />
                </div>
    </div>


Please update the source file, video locations, images for play, stop respectively to work correctly

Happy Browsing!
Relax..

SharePoint - To make Calculated Column as Hyperlink with URL parameters



 Steps to add a hyperlink column/field in the list with query string parameters.

1. Add a calculated field in the list and name it.  Select the calculated field type and in the calculation box, use the URL to compose the address string.
 Example :
 ="<a href='https://myserver/sites/team1?ProjectName="&Title&"'>"&Title&"</a>"

This will add the URL with server name and then add the query string parameter as title of that list item.

2. Select the Calculated field type as "Number".  Please do not select Single line of text. Number will give you the expected result as Hyperlink. (Decimals as Automatic.)

3. Save the field.

This will give the Hyper link the list column with query string parameter from other columns in that list.


Happy Browsing!
Relax..