Pages

Friday, July 12, 2013

How can I add to the hosts file?

 Open the below location in the Windows folder

c:\windows\system32\drivers\etc

Open the Host file and do amendments

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1       localhost
# ::1             localhost

you would like to add say


x.x.x.x website.xyz

Wednesday, July 10, 2013

SSRS Report Server was unable to process request(Sharepoint integrated mode)

An unexpected error occured while connecting to the report server. Verify that the report server is available and configured for Sharepoint integrated mode. --> Server was unable to process request. ---> Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.


Solution:

Check the Report Server websites has started in the IIS.
Restart the SP timer services and SSRS report services.
Check the SQL log files and account could access the SSRS reports.

Thursday, July 4, 2013

SharePoint Designer workflows never reflects the new changes

 
I've ran into this scenario a lot it seems. I'm not sure if it's an issue with SharePoint Designer, or SharePoint itself, but the following seems to occur often:
 
I create a Workflow in SharePoint Designer, and when I save it, it's good to go, and works as expected. However, when opening it later for edits in SPD, I can make changes to the workflow, very large ones, and save it, and on the SharePoint site, it shows as a new version of this workflow, but never reflects the new changes I made to it.
 
 
For instance, I created a simple one to test, simply an email gets sent to me when a new item is created in a list. Works fine. However, when I add an item lookup in the body of the email, save the workflow again, and create a new item in my list, I still get a blank email, not the new item lookup in the body of the email as expected.
Is there some kind of timer with SharePoint updating workflows? Am I missing something here?
 
SOLUTION:
 
For SharePoint Designer, the solution is similar to Dave's solution.
It seems SharePoint Designer saves local copies of DLLs from your servers, and although everything seems OK, this prevents it from updating the workflow (this is when custom activities are involved, which the question didn't mention).
 
To solve this issue for MOSS 2007:
  1. Close SharePoint Designer
  2. Go to
    %LOCALAPPDATA%\Microsoft\WebsiteCache
    Or, on older versions of windows:
    C:\Documents and Settings\%USER%\Local Settings\Application Data\Microsoft\WebSiteCache
  3. Delete either (choose one, based on how annoyed you are by now):
    1. All folders.
    2. The folder that "looks most like your site" (can be more than one: site, site(1), etc, and should be the bottom level site, not the root site)
    3. The relevant DLL in that folder.
  4. Start SharePoint Designer, save the workflow again, it should be ok.
To solve this issue for SharePoint 2013 or 2010:

Go to the folder and delete the files and folders


    C:\Users\LOginUse\AppData\Roaming\Microsoft\Web Server Extensions\Cache
    C:\Users\LOginUse\AppData\Local\Microsoft\WebsiteCache
      Before that take backup  and delete it,
        some sites ask to delete the files and folders in the below location, Don't try to delete, Because after deleting the files the existing workflows never open
        C:\Users\LOginUser\AppData\Roaming\Microsoft\SharePointDesigner\ProxyAssemblyCache

         

        Wednesday, July 3, 2013

        STSADM Commands for Sharepoint 2010

        1.After activating or Deactivating or Deleting Infopath forms in the Central Admin then execute the below commands for immediate execution jobs

        stsadm -o execadmsvcjobs

        .....

         

        Thursday, June 27, 2013

        Friday, May 17, 2013

        Load Sharepoint List Items in the drop down list (Web part page) via SP Object Model


        Load Sharepoint List Items in the drop down list (Web part page) via SP Object Model

         

         

        private void populateAvailiability()

                {

         

                    try

                    {

         

                        ddlAvailability.Items.Clear();

                        string listName = "HR_Comp_Availability";

                        SPSite site = SPContext.Current.Site;

                        SPWeb web = SPContext.Current.Web;

                        Guid webGuid = web.ID;

                        Guid siteGuid = site.ID;

         

                        //new code for spsite

                        SPSecurity.RunWithElevatedPrivileges(delegate()

                        {

                            using (SPSite currentSite = new SPSite(siteGuid))

                            {

                                currentSite.AllowUnsafeUpdates = true;

                                currentSite.CatchAccessDeniedException = false;

                                using (SPWeb itemWeb = currentSite.OpenWeb(webGuid))

                                {

                                    SPList list = itemWeb.Lists[listName];

                                    SPView view = list.DefaultView;

                                    SPQuery query = new SPQuery();

                                    query.ViewFields = "";

                                    //query.Query = " ";

                                    SPListItemCollection items = list.GetItems(query);

                                    DataTable Availability2 = items.GetDataTable();

         

         

                                    if (Availability2.Rows.Count > 0)

                                    {

                                        ddlAvailability.DataValueField = "Title";

                                        ddlAvailability.DataTextField = "Title";

                                        ddlAvailability.DataSource = Availability2;

                                        ddlAvailability.DataBind();

                                        //ddlAvailability.Items.Insert(0, new ListItem("select", "0"));

                                    }

         

                                    else

                                    {

                                        ddlAvailability.Items.Clear();

                                    }

                                }

                            }

                        });

         

                    }

                    catch (Exception ex)

                    {

                        this.lblError.Text += ex.Message + " -- " + ex.StackTrace;

                    }

         

         

                }

        Check User available in that Sharepoint Group or Not using SP Object Model


        If the User available in that SP Group or Not via SP Object Model



        private void GetSecurityGroup()

        {

        // Write your code here.

        string SecurityGroupflag = "";

        using (SPSite siteCollection = SPContext.Current.Site)

        //using (SPSite siteCollection = new SPSite(properties.WebUrl))

        {

        using (SPWeb site = siteCollection.OpenWeb())

        {

        string groupName = "GWPSecurity";

        //Get the current logged in user

        SPUser currentUser = site.CurrentUser;

        //Get all the user groups in the site/web

        SPGroupCollection userGroups = currentUser.Groups;

        //Loops through the groups and check if the user is part of given group or not.

        foreach (SPGroup group in userGroups)

        {

        //Checking the group

        if (group.Name.Contains(groupName))

        {

        SecurityGroupflag = "true";

        break;

        }

        else

        {

        SecurityGroupflag = "false";

        }

        }

        }

        }

        XPathNavigator datasource;

        datasource = this.MainDataSource.CreateNavigator();

        datasource.SelectSingleNode("/my:myFields/my:GWP_Security_Check_Group", NamespaceManager).SetValue(SecurityGroupflag);

        }