none
Export the Workflow details history

    Question

  • Hi,

    I have difficulties in export the workflow details history(which usually on the third page) together with all the data on the first page. For example, from one list, there are about 100 issues listed and each issues have its own workflow details history. If we want to view the history, we need to click on each issues to see the details. My questions is when we export(to spreadsheet) all the issues, I want the workflow history details (e.g. event type, date occured) to be exported together for each issues from the list. I tried to edit the view but couldn't find out the workflow history attribute/column. Please advise if I need to use additional tools/script for this tasks or there is a way underneath the template which I missed out. Man thanks.

     

     

    Tuesday, July 03, 2007 10:00 AM

All replies

  • There is a hidden list in your site called "Workflow History"; history for all workflows on your site get logged there. What you see on the "third page" is this list filtered by workflow instance id. To work with this list like you would with any other list, you need to simply unhide it. You could use the following C# code to make the list visible.

     

    Code Snippet

    using(SPSite site= new SPSite("http://acme.com/"))

    {
          SPList list = site.RootWeb.Lists["Workflow History"];

       list.Hidden=false;

       list.Update();

    }

     

     

    Wednesday, July 04, 2007 4:43 PM
  • Hi Unclepaul,

    Really appreciate your answer. I have searched inside the sharepoint to locate "Workflow history" button, but couldn't find it . Can you guide me on where to get this button, and also where to put this code (since I'm still in new to sharepoint world). Do I need to use other tools which can communicate with sharepoint to put this code? And also do I need to do something on the server side? Kindly advise. Many thanks.

    Thursday, July 05, 2007 1:55 PM
  • You would need to Visual Studio 2005 intalled on machine with a sharepoint instance. Below are the steps you can follow:

    1. Create Console Application project
    2. Add reference to Microsoft.Sharepoint.dll
    3. Replace contents of the class with code from below
    4. Replace http://yoursite with url to ur site
    5. Compile and run on machine where your production sharepoint instance is installed 
    6. Login to ur site, go to View All Site Contents, you should now see Workflow History list

     

    Code Snippet

    using System;
      using System.Collections.Generic;

    using Microsoft.SharePoint;

    namespace MyNamespace
    {
       

        static class Program
        {
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            [STAThread]
            static void Main()
            {
                SPSecurity.RunWithElevatedPrivileges(delegate()
                {
                    using (SPSite site = new SPSite("http://yoursite/"))
                    {
                        SPList list = site.RootWeb.Lists["Workflow History"];

                        list.Hidden = false;

                        list.Update();

                    }
                });

            }
        }
    }

     

     

    Thursday, July 05, 2007 3:34 PM
  • This can also be done in SharePoint Desinger 2007.

    Open the Site

    Click on the Workflow History List.

    Properties > Settings >  Unhide from Browser > Ok

    No Code needed


    Willem Burger SharePoint Consultant
    Monday, February 28, 2011 9:41 AM