Posts

Showing posts from 2011

How to create workflow in Visio and import it in Sharepoint Designer 2010 - Part 2

Image
In previous blog we saw how to create and export the workflow diagram in Visio 2010 ( How to create workflow in Visio and import it in Sharepoint Designer 2010 - Part 1 ). In this blog we import workflow file in SharePoint Designer 2010. Open SharePoint Designer 2010 -> Click on "Open Site" -> In open site window enter site URL on which you want to import the workflow. Click on "Workflows" in Navigation -> Click on "Import from Visio" button from top ribbon -> In Import workflow from Visio Drawing browse the path of export file and click on Next button. In this screen Click on List Workflow and from drop down select "Reimbursement Request" list and click on finish. After click on finish you got following workflow view now we have to set the condition and values for this imported workflow. ...

Content type hub problem with Blank Site Template

As I mentioned in how to deploy content type hub in my previous blog (" Content Type Hubs Publishing in Sharepoint 2010 "), after following blog content type is not appearing on site may required to activate the Taxonomy feature on that site, following command required to activate the feature STSADM -o activatefeature -id 73EF14B1-13A9-416b-A9B5-ECECA2B0604C -url http:// -force Power Shell Command Enable-SPFeature -id 73EF14B1-13A9-416b-A9B5-ECECA2B0604C -URL Hope this work for you also.... Good luck :-)

How to setup content type publishing hub in SharePoint 2010

Image
What is Content Type Hub ? Content type hub is new feature of SharePoint 2010 to manage content type centrally (Content Type Gallery) and publish them to subscribed sites. Prerequisite : Create two web application on two separate port number. we called site A as publisher and site b as subscribed site. Create content type on site A called "Content Type Hub Demo" of document base type.  Create service to deploy content type hub   Open SharePoint 2010 Central Administration - > Click on Manage service applications under Application Management section -> Click on New and select Managed Metadata Service On "Create New Managed Metadata Service" window change following values Name : Content Type Hub Database Name : Content_Type_Hub_Database Use existing application pool: SharePoint Web Service Default Content Type hub : "Enter the url of web site which going to act as publisher for content type". Click on "Ok" button ...

How to create workflow in Visio and import it in Sharepoint Designer 2010 - Part 1

Image
This blog shows how easy to create a workflow in  Microsoft Visio 2010 and import it in Sharepoint Designer 2010. This part contains the prerequisites required and how to design workflow in Microsoft Visio 2010. In this blog we create work for "Reimbursement of Expenses", if my expense amount is less then specified limit then request is directly approved otherwise it goes to Department Head for approval. Prerequisites : I create custom list called "Reimbursement Request" and added following field into it. "Description" type of Multiple lines of text. "Expense Amount" type of Currency. "Authorized" type of  "Yes/No". "Department Head" type of "person and Group". Design workflow with Microsoft Visio : 1. Open Microsoft Visio 2010 : Click on Start -> All Programs -> Microsoft Office -> Click on "Microsoft Visio 2010". 2. Create "Microsoft Sharepoint Workflow" ...

Connect Chart Web Part to SQL database in Sharepoint 2010

Image
1. This blog shows you how to provide data for OOB Charting Web part in Sharepoint 2010. First insert the chart web part into you page as shown in fig. below 2. Create custom web part and specify the database connection as I am retrieving chart data from sql server 2008 database. Copy paste following code into webpart and deploy web part to site collection [ToolboxItemAttribute(false)]     [Serializable]     [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)]     [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]     public class ChartDataProviderWebPart : WebPart, IWebPartTable     {         SqlDataAdapter sda;         Timer _timer;         DataTable _table;   ...

How to programmatically associate a workflow to a list in Sharepoint

In one of your project we have to attach "Sharepoint approval workflow" to list when feature is activated on the web. Prerequisite : SharePoint 2007 Workflows activated on site collection level Task list of content type Task, for storing task created to users.   private void SetWorkFlow(SPWeb web, string listName)         { web.AllowUnsafeUpdates = true; string workflowAssocName = string.Format("{0} - Sharepoint Approval", listName); SPWorkflowTemplate workflowTemplate = web.WorkflowTemplates.GetTemplateByName("Approval - SharePoint 2010", System.Globalization.CultureInfo.CurrentCulture); SPList myList = web.Lists[listName]; // Try to get workflow history and task list SPList historyList = web.Lists["Workflow History"]; SPList taskList = web.Lists["Tasks"]; // Create workflow association SPWorkflowAssociation workflowAssociation = SPWorkflowAssociation.CreateListAssociation( workflowTemplate, workflowAssocName, ...

Create TreeView Structure From Data Table in ASP.Net

One of my friend want to convert Datatable to Tree Structure, hope this will help you. class Program { static void Main(string[] args) { try { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("Id", Type.GetType("System.Int32"))); dt.Columns.Add(new DataColumn("Name")); dt.Columns.Add(new DataColumn("ParentNodeId", Type.GetType("System.Int32"))); DataRow dr = dt.NewRow(); dr[0] = "1"; dr[1] = "Number 1"; dr[2] = "0"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = "2"; dr[1] = "Number 2"; dr[2] = "1"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = "3"; dr[1] = "Number 3"; dr[2] = "2"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = "4"; dr[1] = "Number 4"; dr[2] = "1"; dt.Rows.Add(dr); new CreateTreeNode(dt, "Id", "Name"...

Are you making these 3 common ASP.NET AJAX mistakes?

I found the very usefull link for those who working with AJAX Controls in ASP.Net http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/

How to disable multiple upload button for Document List in Sharepoint 2010

Open upload.aspx file in Visual Studio, upload.aspx file found this file in "14\TEMPLATE\LAYOUTS" folder. Search for "if (hideLink)" statement , you have to set hideLink variable to true for hiding the multiple upload button. hideLink =yourJavaScriptFunction(); if ( hideLink) ... 3. replace yourJavaScriptFunction with your javascript function which returns bool value.

How to Create Event Handler In Sharepoint ?

Open Visual Studio 2010. On the File menu -> New and then click on Project. In project type, select Event Receiver. Enter Name of Event Receiver , click on Ok button. Now you get Sharepoint Customization Wizard, Choose Deploy as a Sandboxed solution, click on Next. In Choose Event Receiver Settings window, Select List Item Events from What type of event receiver do you want? dropdown. In What item should be the event source ? dropdown, choose type of List on which you want Event Receiver. Next Choose event on which you want to write code and click on finish Event Receiver file is created and method for selected event is appeared. Press F5 for deploy this solution.