Thursday, July 30, 2015

How to convert Word documents to PDF by a SharePoint workflow using HarePoint Workflow Extensions.

Introduction
One of the main purposes of SharePoint is collaboration: a group of people can conveniently work with shared documents, making teamwork especially efficient. Usually, text documents are created and edited using Microsoft Word, but when the work is complete, it is convenient to convert the resulting document to PDF. This gives two advantages:
  • No further changes to a document are possible, so it can be safely shared
  • The PDF document can be easily viewed on any device
A Word document can be saved manually as a PDF file right from Microsoft Word’s Save As… menu, but if we talk about tens or even hundreds of documents per week, it would obviously be preferable to have this conversion running automatically. Another thing is that if we browse the short list of workflow actions in SharePoint Designer, we won't find anything related to document conversion. This is where HarePoint Workflow Extensions can help.

Scenario
In this article, we will follow this scenario:
  1. While the team actively works with a document in the document library Active Docs, it has the status "Work in progress". As soon as the job is done the status is set to Completed.
  2. The workflow triggers and converts this Word document to PDF.
  3. When the PDF file has been created, the workflow moves the original Word document to Document Sources library. Only selected team members (such as managers, etc) have access to this document library.
  4. As a result, only the PDF file remains in the original document library, so everyone can view and share this document. This way, the document can be opened easily (also on any mobile device), and at the same time no deliberate or inadvertent changes can be made.
As was mentioned in Introduction, we’re going to use HarePoint Workflow Extensions to perform this automated Word to PDF conversion. So we have the product installed (detailed information about HarePoint Workflow Extensions and its deployment is available on the product homepage: https://www.harepoint.com/Products/HarePointWorkflowExtensions/ and we are ready to go.

Creating a workflow
We can start creating a workflow. This is performed with SharePoint Designer, like we are used to. On the ribbon click New List Workflow for Active Docs list:
A dialog window for creation of a new list workflow will be displayed. Enter a workflow name and optionally a description.  
Important: select the SharePoint 2010 Workflow Platform Type in the drop-down menu, since HarePoint Workflow Extensions uses the 2010 platform type.
Since in our scenario the workflow will be launched every time the document is changed (but not when created), the first action we need to check is whether the document has the Status set to Completed (otherwise no action should be taken).

Add condition If any value equals value:
In the first parameter select Current Item:Status using the lookup:
The second parameter remains equals.

In the third parameter, select Completed:
Now we can add what should be done when this condition is met.

Add a Convert Document action from the HarePoint Activities – Document Conversion category:
In first parameter, select Current Item. Other parameters can be left as default:
The document conversion is not an immediate process, so in order to find out when the conversion has completed, we need to use the Wait Conversion Job action from HarePoint Activities – Document Conversion category:
In the parameter, select Variable:ConversionJobId (it’s the variable that is used in the previous workflow action) using the lookup:   
The workflow will stay on this action until the conversion is completed.
Finally, we will move the original document to Document Sources library that is accessible only for selected team members.

Add action Copy or Move Document from HarePoint Activities – Document Library:
Switch the action from Copy to Move.

In the second parameter (document URL) specify Current Item: Encoded Absolute URL using the lookup:
In the third parameter specify the full URL of the target library:
(typically that looks like http://servername/sitename/subsitename/.../documentlibraryname/)
 Here’s what we have in SharePoint Designer:
Save the workflow. Modify the workflow Start Options in SharePoint Designer to make it run every time the document is changed, but not when created:
Save and Publish the workflow.

Testing a workflow
Now we can make a test. Add a Word document to Active Docs library.

The document will have an empty status field by default (this is how the Status field is set up).
When the work on this document begins, team members edit the document and set the status to Work In Progress:
The workflow triggers, but completes with no actions taken, just as expected.

Now, change the status of the document to Completed:
 First, we notice the workflow status is now In Progress:
 After some time, all the Word document is gone and only the converted PDF remains in Active Docs:
Then, if we take a look at the Document Sources folder (where only selected team members have access), we see the original Word document:
Conclusion
In this article we have reviewed an example of rather simple but efficient workflow for a Team working with shared documents, and have seen how quickly and easily the solution can be achieved by using HarePoint Workflow Extensions – just a couple of actions in SharePoint Designer and no code at all.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Tuesday, July 28, 2015

Product Review: Virto SharePoint Calendar Web Part

Introduction:

Virto SharePoint Calendar Web Part enables users to view all of their events from multiple data sources such as SharePoint Lists, Exchange Calendar, Google Calendar, SalesForce Calendar, SQL Tables or XML and have different views for your easy navigation and reference in one single calendar/or Microsoft Exchange calendars and even from SalesForce Calendars.

Virto SharePoint Calendar replaces the existing SharePoint calendar view's functionality by allowing users to specify the list or view, color code the displayed items by category of events such as internal or external, view day, week, month, year, and Gantt view.

 

Roll up Multiple calendars from different data sources into one Single calendar

The main added value of the SharePoint Calendar web part is the opportunity to have all the events from different data sources displayed in a single SharePoint calendar view, sparing the necessity to switch between multiple views. You can also combine all events from different SharePoint Sites into one calendar! It can show all your events from different SharePoint 2013, 2010 or 2007 lists too.  So you can manage events from different data sources in one calendar.
 
You don't have to synchronize all your calendars from SharePoint, Google, Microsoft Exchange, SalesForce and etc. Install Virto SharePoint Calendar web part and show all the events from multiple data sources in a single place. Use as SharePoint Calendar data sources SharePoint lists from different site collections, SQL tables, Google calendar, XML source, SharePoint lists from other farm, Exchange calendar, SalesForce calendar. This is in comparison to most other SharePoint calendars that can only use one data source, and be displayed in only one view. To distinguish events from different sources in Virto SharePoint Calendar Web Part, one can use multi-level color coding.


 

Different calendar views (Day, Week, Work Week, Month, Year, Task)

Use appropriate timescale for showing your calendar events. Task view allows to control the status of tasks in your SharePoint Calendar web part. If you need to change the duration of the event, modify the size of the cell to the required direction and length. To change the date, simply select the appropriate date in the mini calendar. All of these features will help you save time and complete your calendar tasks with the greatest convenience. 
 
Virto provides editing features that will make working with SharePoint easy and pleasant. If you need to change the date of the event, simply drag and drop it to the appropriate calendar cell. To change the event in time frame in SharePoint Calendar, simply expand the event to incorporate the correct duration of the event.

Color coded data sources

You can visualize the events from your calendars. Customize calendar with special colors for each of data sources and your events will not join anymore! This feature is especially essential when you have more than 2 data sources in one calendar. Use any combination of RGB for coloring events according to their category.

Using Virto SharePoint Calendar Web Part
Virto Calendar implemented in a modern style. The component is fully ready for Windows 8 and SharePoint 2013. Installation is simple and only requires a small amount of time. Currently, Virto supports English, German, Spanish, French, Russian and Chinese Simplified languages. It provides color coding feature that displays items in their SharePoint Calendar web part by category of events (such as internal or external, view day, week, month, year, and Gantt view).

You can contact Virto, If you'd like to add another one language to support SharePoint Calendar Web Part!

 

Key Features & Advantages of Virto Calendar Web Part:

Virto SharePoint Web Part Calendar can be used instead of built-in SharePoint Calendar. It provides you with powerful capabilities for more convenient events calendaring, e.g.:
  • Integrate events from different data sources into one single calendar (from SharePoint Lists, SQL Tables and Microsoft Exchange 2013,  2010 and 2007 Calendars)
  • Add, delete and edit events with drag & drop feature 
  • Multi-level color coding - You can add color legend to remember which colors refer to your events. Event coloring according to event data source, according to event type,
  • Day, Year, Month, Week, Work Week, Task (Days), Task (Hours) views
  • Audience Targeting Support 
  • Advanced filtering, displaying only items satisfied to the specific criteria 
  • Print any Calendar View 
  • Adding Event with a single click
  • Event Coloring according to List Type
  • Date Picker for quick and easy navigation
  • Event duration editing with a simple resizing action
  • Event date changing with a just drag and drop
  • Single aggregated view of all your events from different SharePoint Lists not only single SharePoint Site
  • Resizing to accommodate your web page design

System requirements

Virto SharePoint Calendar web part is available in SharePoint versions 2013, 2010 and 2007. Both in Microsoft SharePoint Foundation 2013 and Microsoft SharePoint Server 2013 (or Windows SharePoint Services v3 SP2 or Microsoft Office SharePoint Server 2007) . 

Conclusion:

Virto SharePoint Calendar enables SharePoint users to plan their activities in a fastest way. The functionality and features of the calendar helps to save the time for real business instead of dying under events and other activities.

Virto SharePoint Calendar Web Part is user friendly and has a simple interface, allowing users to easily create new calendar events with a single click! Included with Virto are editing features that will make working with SharePoint easy and pleasant. You can download it a free 30-days trial at: Virto SharePoint Calendar Web Part

Also, VirtoSoftware releases in the next month a new SharePoint Calendar app for Office 365. Useful options and great quality on the new platform! Find the latest news on www.virtosoftware.com


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Wednesday, July 15, 2015

Disable Alerts on SharePoint 2013 List using PowerShell

Requirement: Temporarily disable Alert Emails on a SharePoint list.

Solution:
SharePoint Alert objects have "Status" property which can be turned ON or OFF. As there is no UI to disable or enable alerts in SharePoint directly from the browser, we can do it programmatically with PowerShell. Here is my PowerShell script to disable alerts on SharePoint 2010/2013 list or library.

PowerShell script to Disable alerts on SharePoint list
Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue

#Function to Disable All Active Alerts on a Given List
Function Disable-ListAlerts($WebURL, $ListName)
{
    #Get the Web and List objects
    $Web = Get-SPWeb $WebURL
    $List = $web.Lists.TryGetList($ListName)

    #Get All Alerts created in the list - Which are Active
    $ListAlerts = $Web.Alerts | Where-Object {($_.List.Title -eq $List.Title) -and ($_.Status -eq "ON")}

    Write-host "Total Number of Active Alerts Found in the list: $($ListAlerts.Count)" 
    
    #Iterate through each alert and turn it OFF
    foreach($Alert in $ListAlerts)
        {
            $Alert.Status="OFF"
            $Alert.Update()
            write-host "Disabled the Alert' $($Alert.Title)' Created for User '$($Alert.User.Name)'"
        }
         
    #Dispose web object
    $Web.Dispose()
}

#Function to Enable all Disable Alerts on a Given List
Function Enable-ListAlerts($WebURL, $ListName)
{
    #Get the Web and List objects
    $Web = Get-SPWeb $WebURL
    $List = $web.Lists.TryGetList($ListName)

    #Get All Alerts created in the list - Which are in Disabled State
    $ListAlerts = $Web.Alerts | Where-Object { ($_.List.Title -eq $List.Title) -and ($_.Status -eq "OFF")}

    Write-host "Total Number of Disabled Alerts Found in the list: $($ListAlerts.Count)" 
    
    #Iterate through each alert and turn it OFF
    foreach($Alert in $ListAlerts)
        {
            $Alert.Status="ON"
            $Alert.Update()
            write-host "Enabled the Alert' $($Alert.Title)' Created for User '$($Alert.User.Name)'"
        }
         
    #Dispose web object
    $Web.Dispose()
}

#Variables
$WebURL = "http://operations.crescent.com/"
$ListName="Proposal Documents"

#Call the function Appropriately to Disable or Enable Alerts 
Disable-ListAlerts $WebURL $ListName

#To Enable it back
#Enable-ListAlerts $WebURL $ListName

Related Posts:


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, July 2, 2015

How to Use JSLink with List View Web Part in SharePoint 2013

What is JsLink in SharePoint 2013:
JSLink is a new method of combining JavaScript, CSS and HTML elements together to customize the look and feel of SharePoint Fields, List Items, List views, List forms and web parts.
 
How to use JSLink in SharePoint 2013?
Here is the SharePoint 2013-jslink example. Lets customize the look and feel of static "% Complete" to bar chart with the help of JSLink. At high-level, here are the steps:
  1. Create a JavaScript override file
  2. Upload the JavaScript file to the "Master Page Gallery >> Display Templates", Set the content type and properties of the file.
  3. Set the JS Link property of the List view web part to point to the JavaScript file we've uploaded.

Step 1: Create your custom JS file to render SharePoint list field
As the first step, We'll have to create a new js file which customizes the rendering of our field. Here is what I've created "TaskListDT.js".
(function () {
var overrideCtx = {};
overrideCtx.Templates = {};
overrideCtx.Templates.Fields = {
'PercentComplete': { 'View': renderPercentComplete }
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
})();

function renderPercentComplete(ctx) {
 
    var fieldVal = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
    var percentComplete = fieldVal.toString().replace(" ", "");
 
    var html = '';
    html += "<div style='width:100%;height:20px;border:1px solid #AEAEAE;position:relative;'>";
    html += "<div style='background-color:#0072C6;height:100%;width:" + percentComplete + ";'></div>";
    html += "<p style='width:100%;text-align:center;position:absolute;top:0px;left:0px;margin:0px;'>";
    html += percentComplete;
    html += "</p>";
    html += "</div>";
 
    return html;
}

Step 2: Upload the JS file to Display Templates Folder
Navigate to Site Settings >> Click on "Master pages" link. >> Navigate to "Display Templates" folder >> Upload your custom JS file. (It could be uploaded to anywhere in the site!)

While uploading, Make sure you set the properties of the JS file. Set the content type as "JavaScript Display Template" and supply other required parameter values as in the below screen.sharepoint 2013 how to use jslink

Step 3: Set JS Link property of List View Web part in SharePoint 2013
The next step is to specify the location of your JavaScript file in the List view web part property. Be sure you follow the "~sitecollection/Your-JS-File-complete-Path" format! (Can also use: ~site, ~layouts, ~siteLayouts, ~siteCollectionLayouts tokens)
jslink list view sharepoint 2013

Here is the Typical "% Complete" column from SharePoint 2013 task list:
sharepoint 2013 jslink property
and Here is our output - Bar charts for "% Complete" column.
sharepoint 2013 list view webpart jslink
In earlier versions of SharePoint (SharePoint 2007, SharePoint 2010), we used to customize XSL for such requirements. Here is one among them: Building Bar chart to Display Progress in Task List

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Monday, June 15, 2015

Move SharePoint Web Application's IIS Physical Path to a New Location

Requirement: Move SharePoint web application's IIS physical location from system drive (c:\) to application drive (d:\) due to new server support policies!

Solution:
SharePoint web applications, by default placed under: "C:\inetpub\wwwroot\wss\VirtualDirectories" when we create them. There is no UI/direct way to change the physical location of SharePoint IIS web sites later. However, these three steps can be utilized to move SharePoint web application's IIS physical directory to a new location:
  1. Copy all contents from the current virtual directory to new directory
  2. Change IIS website's physical path
  3. Update SharePoint web application to point to the new directory path.
Lets automate these manual steps with PowerShell.

PowerShell Script to Move IIS Web Site to New Physical Location:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Import IIS Module
Import-Module WebAdministration

#Variables
$WebAppURL="http://intranet.crescent.com/"
$NewPath="D:\IIS\VirtualDirectories\Intranet.Crescent.com"     
$IISSiteName = "Crescent Intranet" 
 
#Get Web Applications' IIS Settings
$WebApp = Get-SPWebApplication $WebAppURL
$IISSettings = $WebApp.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default]
$OldPath = $IISSettings.Path

#Check if destination folder exists already. If not, create the folder
if (!(Test-Path -path $NewPath))        
{            
    $DestFolder = New-Item $NewPath -type directory          
}

#***** Step 1 - Copy Current Virutal Directory to new location **** #
Copy-Item -Path $OldPath\* -Destination $NewPath -Force -Recurse 

#***** Step 2 - Change IIS Web Site's Physical path ******
Set-ItemProperty "IIS:\Sites\$($IISSiteName)" -name PhysicalPath -value $NewPath

#***** Step 3 - Update SharePoint Web Application ******
#Change the Web App path
$IISSettings.Path = $NewPath
#Update Web Application
$WebApp.Update()
Please note, You'll have to repeat steps 1 and 2 in all SharePoint web front end servers.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


You might also like:

Related Posts Plugin for WordPress, Blogger...