Archive for June, 2011

Whenever you save a list as a template & use it somewhere else, the designer workflow you have associated with the old list will not be restored.  There is no option OOB to copy/move a workflow. But luckily this can be done through the SharePoint Designer. Here below two files play a major role,

The .xoml.wfconfig.xml file contains information on the list the workflow is bound to using the List’s ID.
The file .xoml.rules contains the ‘conditions’ you program for the workflow and the “.xoml” file contains the ‘actions’.

To re-use a workflow you have created in one list(Say List A) in another list(Say List B):

  1. Create a new workflow on the new list(B).
  2. Create at least one step, one condition and one action in this workflow. This ensures that the two files above discussed are created.
  3. From the original workflow(in List A) open the .xoml file as XML and copy the entire contents to the clipboard.
  4. Open the .xoml file for the new workflow and replace the entire contents with the content you have copied in the step 3.
  5. Do the same for the xoml.rules file too.
  6. Now open the .xoml file for the new workflow & verify the workflow. Ensure the workflow is correct by clicking Check Workflow.

You are done 🙂


Some times while trying to contribute to your site you will get ‘Unexpected error’ or HResult error with some error code. If you investigate further by looking into the event viewer log, you will find that a SQL Server error has occured which states that the transaction log is full. Follow the below steps to truncate the transaction log.

  1. Open SQL Server Management Studio and locate your site’s content db(You can find it from the central admin site).
  2. Select your  db and right click to open the backup task.
  3. Select the Transaction Log to backup, go to options and select the radio button Truncate Log.
  4. Start the backup.
  5. That’s it. Transaction Log is truncated 🙂

Executing a SSRS report in the VS works fine, but when deployed in SP environment throws error “User cannot be found“. Below is the detailed error.

System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Report Server has encountered a SharePoint error. —> Microsoft.ReportingServices.Diagnostics.Utilities.SharePointException: Report Server has encountered a SharePoint error. —> Microsoft.SharePoint.SPException: User cannot be found.
   — End of inner exception stack trace —
   at Microsoft.ReportingServices.WebServer.ReportingServiceSPImpl.ListParents(String Item)
   at Microsoft.ReportingServices.WebServer.ReportingService2006.ListParents(String Item)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.SqlServer.ReportingServices2006.ReportingService2006.ListParents(String Item)
   at Microsoft.ReportingServices.SharePoint.Soap.ReportService2006.ListParents(String Item)

But other reports in different sites of the same farm seemed to be working fine. Then digging further, we came to find that the site has been restored from a different domain. The report seemed to reference a user that was in the old domain. The user is marked deleted(tp_deleted flag set to 1)  in the Content DB. We just need to set this as o. But we have to find who is that user and then do the change actually. Follow the below simple steps..

  1. Open SQL Profiler and set up a trace on the target SharePoint Content DB.
  2. Start SQL Profiler trace.
  3. Open the report you are getting the error in a browser.
  4. Go back to the SQL Profiler Trace. You should see, somewhere, a string which looks like the following
    proc_SecGetPrincipalById <GUID>,<INT_1>,<INT_2>,<INT_3>
  5. Here,
    <GUID> is the GUID of your SharePoint site.
    <INT_1> is the user id in UserInfo table that cannot be found and which we want to update.
  6. Run  the following SQL :
    SELECT * FROM UserInfo WHERE tp_SiteID = <GUID> AND tp_ID = <INT_1> (<GUID> & <INT_1> comes from step 5)
  7. Check if the value of  tp_Deleted = 1. If yes set it to 0 using the below sql query.
    UPDATE UserInfo SET tp_Deleted = 0 where TP_Id = <INT_1> AND tp_SiteID = <GUID>
  8. If the error persists, repeat steps 3 to 7 as there may be more users.

You are done. Reports work like charm 🙂

Wondered how you can find the size of all the files combined together that are uploaded in a particular document library?? Obviously you can find it through code. But the simple way is through the SharePoint Designer.

  1. Open the site in the designer
  2. Right-click on the document library you want to find the size of.
  3. Click on properties, which opens the pop-up to show the size of the entire document library. 🙂

Sometimes while creating a workflow using a SharePoint Designer you may encounter the error Access Denied even if the user is having Full Control for the site.

First thing you should check is, whether you are having permissions on the list to which you are attaching the workflow.

If you face the problem even after doing that, ensure you do the below steps.

  1. Open the site in the browser.
  2. Right click on the Workflows folder and select Properties.
  3. In the Security tab, select “Manage Permissions using the browser“.
  4. In the workflows list’s permissions window, provide permission for the user you are facing the issue.

Now work like a charm 🙂