Showing posts with label SharePoint Libraries. Show all posts
Showing posts with label SharePoint Libraries. Show all posts

Jan 18, 2017

Enable "Open with Explorer" Option In SharePoint Online Document Libraries In Microsoft Edge Browser

Happy New Year 2017 to all readers and wish you all success in this year 😃😃😃

I was asked by my colleague who is from different Technology stream about “Open with Explorer” option disabled in SharePoint Online document libraries in Microsoft Edge browser.
Microsoft Edge browser has a new look and feel than other IE versions and obviously it is going to take a while for all end users to get used to / to know the various options in it.I tried checking the permissions of the user and he has admin permissions but still the user couldn’t open the library with explorer option as shown below:
As usual searched for various articles and understood about the features of Microsoft Edge browser.Read this KB article about Microsoft Edge and SharePoint behavior:

Solution:
Navigate to the edge browser -> click on Open with Internet Explorer as shown below:

Now, the SharePoint site should open in the IE 11 (latest version before Microsoft Edge is released).As expected, in IE 11, Open with Explorer option is enabled and everything works perfectly as shown below:
If you want to sync, click on Sync and it will open the One Drive -> Sign in -> Sync the data.

Hope this helps you!
Please share your valuable comments which will help me write more and share this post using the social buttons below.

Jul 14, 2015

Could not load type ‘Microsoft.AnalysisServices.SpAddin.ReportGallery.ReportGalleryView’

Recently, I have installed the power pivot in SharePoint 2013 and then configured the power pivot service application in the Central Administration.
I tried creating a Pivot Gallery and it is successful. When I opened the pivot gallery library, it is showing the below error: 
I am sure some feature is not activated but couldn’t find it. Then, checked the Central Administration -> System Settings -> Manage Farm Solutions -> powerpivotwebapplicationsolution

This solution should be deployed to the web application in which have created the pivot gallery.

Happy learning! Please share this post if it helps you!

Aug 6, 2012

Event ID 28721 in Source cannot be found

Problem:I have faced this problem when I tried to upload a document one of my document library in SharePoint. Neither the upload is successful nor no errors while uploading.
Event Log:I was unable to view any errors with respect to the document upload in the event log. I could see only the following logs in the event viewer:
Event Type: Error
Event Source: Windows SharePoint Services 3
Event Category: General
Event ID: 28721
User:  N/A
Description:The description for Event ID ( 28721 ) in Source ( Windows SharePoint Services 3 ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: #960013: Antivirus scanner timed out.


Following are the investigations done for fixing the errors:
1. Checked the file size limit in the web application general settings – but I have tried to upload only a few KB text file.
2. Checked the SQL server logs and there is enough space for the upload.
3. Created a new document library and tried attaching a new document which is unsuccessful.
4. Created a new list and added an item which is successful. But when tried attaching a document (or text or small file) it is unsuccessful.
Hence, I have concluded that there is no problem with SharePoint or any corruption of document library or list definition.
Looking at the event log carefully, I finally came to an idea that Antivirus is blocking something and it is where the problem is arising.

Solution:1. I have tried changing the Antivirus settings in the Central Administration 
2. Go to -> Central Administration -> Operations -> Antivirus -> Antivirus Settings -> I have unchecked the option Scan Documents on Upload -> Clicked save
3. Now, I have tried uploading the documents in the document library which is successful. Hence, concluding that the problem is due to the Microsoft Fore Front Security Antivirus.
4. Note: But we cannot make this option as default, since without antivirus scan, unwanted files (viruses, malwares, spywares, etc.,) may be uploaded which would be threat to the SharePoint environment.
5. Finally, updated the Antivirus definitions and license for the Fore Front antivirus. Then onwards, the upload is successful and secured one.

Microsoft Fore Front Security Antivirus1.  It is an antivirus provided by Microsoft dedicated to SharePoint environment. It will protect the SharePoint environment from the virus, spywares and other treats being uploaded.
2.  To know about the Microsoft Fore Front Security Antivirus click on this link
http://sharepoint.microsoft.com/en-us/product/Related-Technologies/Pages/Forefront-Protection-2010-for-SharePoint.aspx
3.  In the central Administration -> Operations -> Antivirus -> Antivirus Settings -> Scan documents on upload is set, then all the documents being uploaded will be scanned by the for front and then only uploaded into the SharePoint environment.

Happy Sharing!

May 9, 2012

CAML Query to Get Data from SharePoint List

To know about the Basics of the CAML query read this article.
To know about using CAML query builder to create CAML queries, read this article.
In this article, we will learn how to use CAML query in Microsoft Visual Studio
Scenario:
I have a custom list named “Product List” with the columns named Title, Price, Quantity and Is Available.
I want to retrieve the products with price greater than 1000 and lesser than 10000. Then I have to order the results depending upon the quantity in descending order.
Using the CAML query builder, I have created a CAML query for the above scenario and the query is as follows:
<Query><Where><And><Gt><FieldRef Name="Price" /><Value Type="Number">1000</Value></Gt><Leq><FieldRef Name="Price" /><Value Type="Number">10000</Value></Leq></And></Where><OrderBy><FieldRef Name="Price" Ascending="False" /></OrderBy></Query>

Implementing CAML Query in Microsoft Visual Studio
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;

namespace UsingCAMLQuery
{
    class Program
    {
        static void Main(string[] args)
        {
            const string camlQuery = @"100010000";
            try
            {
                using (SPSite objSite = new SPSite("sitename"))
                {
                    using (SPWeb objWeb = objSite.OpenWeb())
                    {
                        // Building a query
                        SPQuery query=new SPQuery();
                        query.Query=camlQuery;
                     
                        // Retrieving the data from the List
                        SPList objList=objWeb.Lists["Product List"];
                        SPListItemCollection items= objList.GetItems(query);

                        // Prinitng the header
                        Console.WriteLine("{0,-25} {1,-20} {2,-15} {3}", "Title", "Price", "Qunatity", "Is Available");

                        foreach (SPListItem objListItem in items)
                        {
                            Console.WriteLine("{0,-25} {1,-20} {2,-25} {3}", objListItem["Title"], objListItem["Price"], 
                                                                             objListItem["Quantity"], objListItem["Is Available"]);
                        }

                    }
                    Console.ReadLine(); 
                }
 
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error Occured:", ex.Message);
            }
            Console.ReadLine();
        }
    }
}
The full solution can be downloaded from the following link
Please free to comment and share this post if it helps you!

The list cannot be displayed in datasheet view for one or more of the following reasons in SharePoint

I was easily changing my list view by edit in data sheet view and in standard view. 
After sometime, when I tried to edit a SharePoint list in DATASHEET view, I got the following error which doesn't allow me to view the list in the datasheet view and shown up a error as shown below:
Solution:
Clearly, the problem is due to some DLL's in the MS office is creating this problem.
Hence, either of the following solutions will help you to fix this error:
Microsoft Office diagnostics
Run the Microsoft office diagnostics tool by navigating to the following location:
Start -> All Programs -> Microsoft Office -> Microsoft Office Tools -> Microsoft Office Diagnostics
This will repair the office setup installed in the machine. you may see the following screens running once started
Once completed, you will see the following screen:
                            
Installing Office2007 SharePoint Components
I read a wonderful article for this and the link is
Either of the above solutions will help you in fixing this issue.
Hope this saves some one’s time. Happy Sharing!

Using CAML Query Builder for SharePoint

To know about the Basics of the CAML query read this article.
Download Link
Use the following link to download the CAML Query builder.
How to use CAML Query Builder to create a query
Following are the steps for using the CAML query builder to create a CAML query
1. Open the CAML query builder. Type the URL to connect to the SharePoint site and check Credentials of the current user to login

2. Once clicked connect, you will see the following window SharePoint site with all the lists and libraries in the site in a tree view structure which is shown below: 

3. Now we will create a new query on a list named “Product List” as shown below:

4. We will start creating a new query which is as follows:



5. You will find the query being created depending upon your selection from the list

6. Clicking on Execute, you will see the query being executed and the result is being displayed in the result tab as shown below:

The Query created is:
<Query>
           <Where>
                       <Gt>
                              <FieldRef Name="Quantity" />
                              <Value Type="Number">0</Value>
                      </Gt>
          </Where>
          <OrderBy>
                       <FieldRef Name="Price" Ascending="True" />
          </OrderBy>
</Query>
Hence, CAML Query Builder allows us to create the queries very easily so that it can be used in the SharePoint programming.
Now, we will have a question, how to use this query in the Visual Studio to retrieve the data from a list.
To know how to use CAML query in Visual Studio programming, read this article.

May 8, 2012

CAML Query tutorial for SharePoint

In this article, we will understand the basics of CAML query in SharePoint.
What is CAML?
  Ø  CAML - Collaborative Application Markup Language
  Ø  XML- Extensible Markup Language based query language
  Ø  Used to perform a query operation against SharePoint Lists
How SharePoint List Items are retrieved?
SharePoint List data can be retrieved in any one of the following ways:
1. Using the SharePoint object model – used when code runs on the server (Example: Developing a web part or an application page)
2. Using the SharePoint Lists web service – used when your code doesn’t run on the server where the SharePoint is installed (Example: Developing a windows application)
3. Using Power shell –used mostly by the ADMIN of the SharePoint when they quickly want to retrieve some information from the SharePoint site
How does CAML query looks like?
As I already mentioned, it is XML based query language and it contains tags in it. The root element of the CAML query root element is Query. But it is not necessary to use Query element in the query you form.
Within the Query element you have two elements possible:
1. Where   – to filter the data
2. OrderBy – to categorize the data
A simple structure of the CAML query is as follows:
<Query>
          <Where>
                   <Eq>
                             <FieldRef Name=”FieldName” />
                             <Value Type=”DataType”>Value</Value>
                   </Eq>
          </Where>
          <OrderBy>
                             <FieldRef Name=”FieldName” />
                             <FieldRef Name=”FieldName” />
          </OrderBy>
</Query>
Operators in CAML Query
From the above structure, we came to know that it uses Where and OrderBy elements to retrieve the data from the list.
Let us know about the operators present in the CAML query and its usage:
Inside the Where element
1. Logical Operators - AND, OR
2. Comparison Operators - Listed Below in the table
AND – Which takes two conditions are satisfied
OR – Which takes when either of the conditions is satisfied
Comparison Operators

Inside the OrderBy/GroupBy element
OrderBy – Which orders or sort the data depends upon the field (FieldRef element) given.
GroupBy – Which groups the data depends upon the group by field (FieldRef element) given.
Examples
Logical & Comparison Operators
Use of AND, Gt, Leq
<Query>
<Where>
<And>
<Gt>
<FieldRef Name="Quantity" />
<Value Type="Number">0</Value>
</Gt>
<Leq>
<FieldRef Name="Price" />
<Value Type="Number">2000</Value>
</Leq>
</And>
</Where>
</Query>
Use of OR, Gt, Leq
<Query>
<Where>
<Or>
    <Gt>
<FieldRef Name="Quantity" />
<Value Type="Number">0</Value>
    </Gt>
                     <Leq>
  <FieldRef Name="Price" />
<Value Type="Number">2000</Value>
    </Leq>
               </Or>
       </Where>
</Query>
Use of BeginsWith, Leq
<Query>
<Where>
<And>
     <BeginsWith>
 <FieldRef Name="Title" />
 <Value Type="Text">M</Value>
     </BeginsWith>
     <Leq>
    <FieldRef Name="Quantity" />
<Value Type="Number">1000</Value>
     </Leq>
</And>
</Where>
<OrderBy>
<FieldRef Name="Price" Ascending="False" />
</OrderBy>
</Query>
OrderBy Operator
<Query>
<Where>
<Or>
   <Gt>
<FieldRef Name="Quantity" />
<Value Type="Number">0</Value>
  </Gt>
    <Leq>
<FieldRef Name="Price" />
<Value Type="Number">2000</Value>
  </Leq>
</Or>
</Where>
<OrderBy>
<FieldRef Name="Price" Ascending="True" />
</OrderBy>
</Query>
Is it possible to write this queries without any errors manually?
Yes. But we will know the errors only after executing the program. Hence there is a free CAML query builder which will generate the query easily.
To know about where to download and how to use the CAML Query builder read this article.
To know how to use the CAML query in the Microsoft Visual Studio read this article.

Apr 16, 2012

Workflow using SharePoint designer 2007

To know about the basics of the Work flows in SharePoint, read this article.
In this article, we will learn how to create a designer workflow in SharePoint designer 2007.
Scenario:
1.   Create a workflow in SharePoint designer 2007
2.   This workflow should be automatically triggered when an item is created or updated in a SharePoint Document library
3.   When the workflow is initiated, then the document created or updated in the document library should be copied to another document library
4.   Also, we will have parameter (flag) in the document library whether to move or not in the document library.

Solution:
We will create two document libraries named, “Draft Library” and “Publish Library”.
In the Draft Library we will create an additional column named Move to Publish Library of type Choice menu (YES or NO)
When a document is uploaded or updated in Draft Library with the flag value equals to yes, then the workflow should be triggered which will copy the item to the Publish Library.

Steps:
Open the SharePoint site in the designer and click on File -> New -> Workflow


Give the name of the workflow and Select the document library for the workflow to be associated (Draft Library in our case). Then Select two options Automatically starts the workflow when an item is created or change and click on Next.


In the Step1, click on the conditions and select Compare Draft Library field


Now, select the Move to Publish Library column and Value equals to Yes as shown below



Now we will apply the action for the workflow. Click on Actions -> Copy List Item. 


Now select Draft Library to Publish Library in the values as shown below


Once you click on finish, then the workflow will be associated to the “Draft Library”.


Navigate to the SharePoint Document library and when you check the workflow settings, and then you will see the MoveDocuments workflow associated with the Draft document library.


Now, we will test the workflow. Go ahead and upload a document into the “Draft Library”. Select YES in the Move to Publish Library option as shown below:


Now, our workflow will be initiated and you will see the status of the workflow (completed) in the document library as shown below:



Click on the completed in the document library where you will be navigated to the workflow information as shown below:


Now, navigate to the publish library, you will see the document being copied as result of the workflow as shown below:


Now, at the end of this article we have learned the following from this article:
1. Creating a Designer workflow in SharePoint using SharePoint designer 2007.
2. Used workflow to copy an item form one document library to another document library.


To know about the new features added in SharePoint Designer 2010, read this article.

Free to comment if this article helps you!

Jan 6, 2012

Creating and Deploying a Visual Web Part using Microsoft Visual Studio 2010

To know about the Basics of Visual web part, read this article before knowing how to create and deploy the visual web part using visual studio 2010.
We will create a Visual web part for uploading the document to the SharePoint document library.
At the end of this article, we will learn
     1.How to create and deploy a Visual Web part
     2.How to programmatically upload a document to the SharePoint Document library

Open the Visual Studio and create a Visual Web Part project as shown below

When you click OK, you will see a pop-up window which will ask for the SharePoint site where the web part is going to be deployed as shown below. Hence give the proper URL of the SharePoint site. Also select the option Deploy as a farm solution because, visual web part is not a sandboxed solution

Once clicked Finish, you will see the project created with all the necessary files (assembly, .ascx files, feature to be deployed, .web part file) for a web part in the solution explorer as shown below

Click on the .ascx file and in the design mode, drag and drop the controls (FileUpload Control and Button) as shown below and complete the design part
I have added a JavaScript code which we used in this article for validating the file being uploaded is only .doc and .docx file.

Now, we will go for the coding the functionality of the web part. I have added a code in the Button1_Click event (Upload) of the web part as shown below

In the above code, give the proper name of the Document Library. I have used the default document library “Documents”.
Now Build the application and check for the errors. Once the build is successful, our web part is ready to be deployed in the SharePoint site.
It is very easy to deploy the visual web part. See the screenshot below.

That’s it. We have deployed our solution to the SharePoint site, which we have mentioned during creating the project.
Now, we will use the web part in our share point page.
Go to the SharePoint page -> Edit Page -> Insert web part -> Categories -> Custom -> Select the web part created (in our case I have named visualwebpart1)

Once added, we will see our web part designed in the SharePoint site page.

I will select a file and click upload. The file will get uploaded into the document library mentioned in the code.

Once Clicked Upload, the document is uploaded into the document library as shown below.

That’s it! We are done. We have learned to create and deploy the visual web part in SharePoint 2010.


Jan 3, 2012

How to Remove “+ Add document" from a SharePoint 2010 Document Library

In previous article, we have learned how to hide the Select/ Deselect Check Box from a view in the list/libraries.
In this post, we will see how to remove the + Add document” option from the document library in SharePoint 2010.
We will get some scenarios where, we will display the document library I different view and in that, we don’t want this option to be shown to the users. Because, it will allow the users to upload the documents.
Suppose the below is the document library where we want to hide the Add document option
 
We can achieve this by the following methods
1.   Editing the WebPart
2.   Using SharePoint Designer(CSS)
3.   Using J Query
4.   By Permission level(Default)

1. Editing the WebPart
Go to Edit WebPart -> Tool bar Type -> Select NoToolBar option which will hide the Add Document option
2. Using SharePoint Designer(CSS)
Go to the designer and edit the page/webpart where you want to hide. Search for class=”ms-addnew” and change the style to Style=”display:none”
3. Using J Query
Add a CEWP and link the following J-Query in it and hide the CEWP webpart
$(document).ready(function()
{
$(‘#WebPartWPQ2 .ms-addnew’).hide();
});
4. By Permission Level (Default)
We can set the permission level for the document library to read only and hence the user with read only option in the SharePoint site will not see this option
We will get the following result