Monday, March 31, 2014
Friday, March 14, 2014
How to Use Microsoft Excel to Query a SharePoint List
A great way to extract and expose data from SharePoint is by using
Microsoft Excel. Of course, not by doing a simple copy-paste, but by
using an Excel query.
Editor's note: Contributor Alexandru Dionisie is an Internet Professional and Technical Writer. Follow him @tutorialeoffice
A great way to extract and expose data from SharePoint is by using Microsoft Excel. Of course, not by doing a simple copy-paste, but by using an Excel query.
Even though Excel’s query editor is not that great looking (like the one from Microsoft Access), it still is functional and very helpful.
I am going to use a query in Excel to extract only a part of a SharePoint list data.
Still, you can create your own query, with a custom SQL code. As you can see in the bellow image, that workbook is connected to the SharePoint list through that Microsoft Excel Web Query file.
Save the above Excel file and then open a blank workbook. From the Data tab click on the From Other Sources button and then click on the From Microsoft Query option.
Returning to form 2, we have to choose a default table (or sheet) – step 4.
Now we have a new source. To add a custom SQL code, just click on the OK command button.
In the query editor I will enable the Criteria pane (from the View menu) because I want to see certain products that have a custom price.
More than that I want to see only some column: Categorie, Produs and Pret.
Criteria:
If I want to see what the SQL code looks like, I will click on the SQL button from the toolbar.
To add the query result in a sheet, just close the query editor.
Now, the Import Data form is displayed.
Choose a cell to put the data in and the click the Properties command button.
In this form we have to check the first and the third option, so that the data updates in the background and when the file open.
After we confirm all the options, the data will be imported in the
sheet. Now we can create custom reports and charts, based on this data.
If you want others to use this method, just export the query from the
query editor. Then, all they have to do is to double click on the query
and the data is imported.
To edit the query you can use Notepad or the query editor.
After some tests, it seems that the data is not refreshing.
Why ? Because the first Excel workbook (the one created after running the Web Query) wasn’t updated either. So, update the first workbook and then the second one.
To avoid the above procedure, in the first workbook (created by the Web Query) we must export the second query and import it into the first workbook.
Now, we have only one workbook that contains the Web Query and the ODBC Query.
Editor's note: Contributor Alexandru Dionisie is an Internet Professional and Technical Writer. Follow him @tutorialeoffice
A great way to extract and expose data from SharePoint is by using Microsoft Excel. Of course, not by doing a simple copy-paste, but by using an Excel query.
Even though Excel’s query editor is not that great looking (like the one from Microsoft Access), it still is functional and very helpful.
I am going to use a query in Excel to extract only a part of a SharePoint list data.
Here are the steps
- Open the SharePoint list and from the list tab click on the Export to Excel command button.
- Save the Microsoft Excel Web Query file.
- If you want to see the query file content, open it using Notepad.
- Double click on the Microsoft Excel Web Query file to open it using Microsoft Excel.
Still, you can create your own query, with a custom SQL code. As you can see in the bellow image, that workbook is connected to the SharePoint list through that Microsoft Excel Web Query file.
- make sure that the Use the Query wizard to create/edit queries is unchecked.
- click on the New Data Source option (form 1) and then click on the OK button.
- in form 2:
- add a name for the new source (step 1);
- select the Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb) - step 2
- click on the Connect command button (step 3);
- in form 3 click on the Select Workbook command button;
- in form 4 select your workbook.
More than that I want to see only some column: Categorie, Produs and Pret.
Criteria:
- Product category (Categorie = LCD 22);
- Custom Price (Pret >=400)
Now, the Import Data form is displayed.
Choose a cell to put the data in and the click the Properties command button.
To edit the query you can use Notepad or the query editor.
Why ? Because the first Excel workbook (the one created after running the Web Query) wasn’t updated either. So, update the first workbook and then the second one.
To avoid the above procedure, in the first workbook (created by the Web Query) we must export the second query and import it into the first workbook.
Now, we have only one workbook that contains the Web Query and the ODBC Query.
Author :Alexandru Dionisie |
Useful Sharepoint Blogs
Useful Sharepoint Links
Change Calendar Item appearance
|
Amol Ghuge’s Blog
|
Nidhi’s
Blog
|
Pratik’s SharePoint Blog
|
Karthick’s Blog!
|
Vishal Joshi’s SharePoint Blog
|
Fix the problem where IE crashes
when opening Office documents on SharePoint
|
How to move/migrate SharePoint
list items/documents and preserve metadata properties at the same time
|
Comparing Windows Kerberos and
NTLM Authentication Protocols
|
Determine permission levels and
groups (SharePoint Server 2010)
|
Plan for sites and solutions
(SharePoint Server 2010)
|
Business data and processes
planning (SharePoint Server 2010)
|
Plan InfoPath Forms Services
(SharePoint Server 2010)
|
Plan workflows (SharePoint Server
2010)
|
SharePoint Online Administration
Guide
|
Backup and recovery (SharePoint
Server 2010)
|
Backup and recovery best practices
(SharePoint Server 2010)
|
Database management (SharePoint
Server 2010)
|
Security and permissions
(SharePoint Server 2010)
|
Health monitoring (SharePoint
Server 2010)
|
Mike Smith’s Tech Training Notes
|
A simple method to display a list
in another site
|
Content Deployment – Step By
Step Tutorial
|
Integrating InfoPath 2007 with the
Data Connection Library
|
Publishing and Synchronizing Excel
2007 Tables to SharePoint Lists
|
Ten tutorials about creating
PivotTable reports for Excel Services
|
SP 2010 “FAQ”
|
WSS3/MOSS FAQ
|
Configure alternate access mapping
|
Javascript
Video Tutorials
|
Abhishek Bhowmick | SharePoint and
more…
|
SharePoint 2007 hard limitations
|
White Paper – Six Pillars of
SharePoint
|
Approaches to Creating Master Pages
and Page Layouts in SharePoint Server 2007
|
Modify the default master page
|
CREATING CUSTOM SITE DEFINITIONS
|
SharePoint 2007 Free Web parts
|
RSS Reader with Images for
SharePoint 2007
|
Demos and training for Office
SharePoint Server 2007
|
Hardware and software requirements
(SharePoint Foundation 2010)
|
This file is not in a recognizable
format
|
How to configure Incoming Email
Enabled Libraries in MOSS2007 RTM using Exchange 2007 in an Active Directory
Domain
http://www.combined-knowledge.com/Downloads/2007/How%20to%20configure%20E
http://www.sharepointdiary.com http://nikhilkaimal.wordpress.com/category/technology/moss-sharepoint-2007/ |
Tuesday, March 4, 2014
Exporting User Profiles Property in Sharepoint 2010 into excel
((Reference: http://csefi.blogspot.com/2012/02/sharepoint-2010-user-profile-export-to.html))
Don't you often hear the question from users: "How can I export the user profile to excel?" Many clients use the SharePoint user profile to synchronize user data from diffent directory services into SharePoint so everyone can find all the necessary information at one place. The only thing that customers miss is the built in functionality to export all the user information.
I've written a small application which has four functionalities:
You can download the application from here.
and...
you can download the source code from here.
Cheers,
Cséfi
By adding Microsoft.Office.Server.UserProfiles.dll to your project, you will be able to use UserProfileManager class and get all the information you need. There are many blogs that explain how to use these classes so I'm not going to do it agian.
Web service
SharePoint 2010 has a built in user profile webservice. You just need to add as a Web reference to your project. The URL of the webservice is: http://yourserver/_vti_bin/userprofileservice.asmx
After you've added the reference to your project you will have a UserProfileService proxy class and you will be able to do all kind of things just as with object model, like getting User Profile properties, user profiles, etc.
Powershell script
You can do almost everything with Powershell scripts and it is not different when it comes to user profiles. Here is a little example to get user profiles from User Profile:
$serviceContext = Get-SPServiceContext -Site http://server
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext);
$profiles = $profileManager.GetEnumerator()
foreach($userProfile in $profiles)
{
#Do something
#$propertyName = "Title"
#Write-Host $userProfile[$propertyName];
}
I've written a small application which has four functionalities:
- Connect User Profile and list the properties and their types
- Export user profiles into CSV with the selected user profile properties
- Generate powershell script to export user profiles into CSV with the selected properties
- List user's properties
You can download the application from here.
and...
you can download the source code from here.
Cheers,
Cséfi
Afterwords
This blog is not intend to explain how you can work with user profile store, because there are many blogs already about this topic. Just bing for it. In nutshell there are three ways how you can work with user profiles. You can use powershell script or object model to get the required data.
Object modelBy adding Microsoft.Office.Server.UserProfiles.dll to your project, you will be able to use UserProfileManager class and get all the information you need. There are many blogs that explain how to use these classes so I'm not going to do it agian.
Web service
SharePoint 2010 has a built in user profile webservice. You just need to add as a Web reference to your project. The URL of the webservice is: http://yourserver/_vti_bin/userprofileservice.asmx
After you've added the reference to your project you will have a UserProfileService proxy class and you will be able to do all kind of things just as with object model, like getting User Profile properties, user profiles, etc.
Powershell script
You can do almost everything with Powershell scripts and it is not different when it comes to user profiles. Here is a little example to get user profiles from User Profile:
$serviceContext = Get-SPServiceContext -Site http://server
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext);
$profiles = $profileManager.GetEnumerator()
foreach($userProfile in $profiles)
{
#Do something
#$propertyName = "Title"
#Write-Host $userProfile[$propertyName];
}
Subscribe to:
Posts (Atom)