You need workflow status name (list column) when you get a item's workflow status. But you can't get workflow status name from SPWorkflow properties directly. You need to use SPWorkflow.AssociationId property and SPList.WorkflowAssociations property to get workflow status.
The sample code is here.
using System; using Microsoft.SharePoint; using Microsoft.SharePoint.Workflow; // This is Console Application // SPSite site = new SPSite("http://sharepoint-site"); SPWeb web = site.OpenWeb(); foreach (SPList list in web.Lists) { foreach (SPListItem item in list.Items) { foreach (SPWorkflow workflow in item.Workflows) { try { Console.WriteLine("item url : " + item.Url); Console.WriteLine("workflow name : " + list.WorkflowAssociations[workflow.AssociationId].Name); Console.WriteLine("workflow status : " + item[list.WorkflowAssociations[workflow.AssociationId].Name]); Console.WriteLine(); } catch (ArgumentException) { //ArgumentException is throwed if the workflow is not exist in the list column. Console.WriteLine("Workflow name : {0} is already not exist in List title : {1}.", list.WorkflowAssociations[workflow.AssociationId].Name, list.Title); } } } }
The result is like this :
item url : Lists/Announcement01/1_.000Workflow status is displayed as a number. The workflow status number are related to SPWorkflowStatus Enumeration. For example, number 2 means "InProgress".
workflow name : Approval01
workflow status : 2