Saturday, April 26, 2014

SharePoint 2013 feature deployment error: Failed to get the list schema XML for feature in GetUserListSchema()

While deploying SharePoint solution I got an error saying that

Error occurred in deployment step ‘Activate features’: Cannot complete this action. By checking the error in logs I have found the exception details as

GetUserListSchema(): Failed to get the list schema XML for feature

By digging into the issue I have found that there is some scope activation details we are unable to deploy this feature. In the code I have added a list definition and list template associated to that list definition. I have added a new feature scoped with site and moved List definition feature to that. So here I have changed the List definition scope from web to Site and kept list template on the same scope. While deploying the feature I got the error on that.

To fix this issue we have to edit the list instance elements.xml file and need to update the list definition feature id in elements.xml file.  
We can update the list inastance elements.xml as

  <ListInstance Title="Name of the list instance"
                TemplateType="10000"
                FeatureId="List definition Feature ID"
                Url="Lists/InstanceName"
                Description="List instance description">
  </ListInstance>



By updating the feature id, Iam able to deploy the solution without issues. Hope this helps.

SharePoint – Back to basics- Creating lists using excel by using Import spread sheet template

We can create SharePoint list using Excel sheet using Import Spreadsheet Template. As a Developer\Administrator we can have knowledge on how to create the lists and libraries. But End users will not aware of this. For this purpose we have an option to create the list by using excel sheet having data.

To create using Excel sheet we have an option “Import Spreadsheet” as shown the image below.



While creating the list, Select “Import Spreadsheet” option. By selecting the option we’ll be navigated to details form page as below. Enter Name and description for new list and browse the Excel sheet in File location. Click on Import Button to update the data to select the data from the list.



Once user importing the data, list will be created with all the existing columns in sheet. Sometime SharePoint will not identify the type column. That’s only disadvantage with this option
Hope this helps.


Saturday, April 19, 2014

Send meeting request in SharePoint custom workflow

Working with SharePoint workflow I got a requirement to send meeting request by using the code. I have dig into deep to check if there is any option to send meeting requests by using SharePoint workflow but I couldn’t find anything. So we have only option to send meeting request through C# code.
My friend Ravi helped me on the code finally by using the code below we are able to send the meeting requests.

private void SendMeetingRequestMail(VacationRequestMail reqMail, string smtpTO, string smtpServer, string smtpFrom)
        {
            using (MailMessage mailMessage = new MailMessage(smtpFrom, smtpTO))
            {
                mailMessage.Subject = “Subject”;
                mailMessage.Body = “Body”;


                DateTime startDate = “Start Date and Time
                DateTime endDate = “End Date and Time

                StringBuilder str = new StringBuilder();
                str.AppendLine("BEGIN:VCALENDAR");
                str.AppendLine("PRODID:-//Vacation Request Portal");
                str.AppendLine("VERSION:2.0");
                str.AppendLine("METHOD:REQUEST");
                str.AppendLine("BEGIN:VEVENT");
                str.AppendLine(string.Format("DTSTART:{0:yyyyMMddTHHmmssZ}", startDate));
                str.AppendLine(string.Format("DTEND:{0:yyyyMMddTHHmmssZ}", endDate));
                str.AppendLine("LOCATION: Vacation Request Portal, India");
                str.AppendLine(string.Format("X-MICROSOFT-CDO-ALLDAYEVENT:TRUE"));
                str.AppendLine(string.Format("UID:{0}", Guid.NewGuid()));
                str.AppendLine(string.Format("DESCRIPTION:{0}", mailMessage.Body));
                str.AppendLine(string.Format("X-ALT-DESC;FMTTYPE=text/html:{0}", mailMessage.Body));
                str.AppendLine(string.Format("SUMMARY:{0}", mailMessage.Subject));
                str.AppendLine(string.Format("ORGANIZER:MAILTO:{0}", mailMessage.From.Address));
                str.AppendLine("X-MICROSOFT-CDO-BUSYSTATUS:FREE");
                str.AppendLine("BEGIN:VALARM");
                str.AppendLine("TRIGGER:-PT18H");
                str.AppendLine("ACTION:DISPLAY");
                str.AppendLine("DESCRIPTION:Reminder");
                str.AppendLine("END:VALARM");
                str.AppendLine("END:VEVENT");
                str.AppendLine("END:VCALENDAR");
                System.Net.Mime.ContentType ct = new System.Net.Mime.ContentType("text/calendar");
                ct.Parameters.Add("method", "REQUEST");
                AlternateView avCal = AlternateView.CreateAlternateViewFromString(str.ToString(), ct);
                mailMessage.AlternateViews.Add(avCal);

                using (SmtpClient smtpClient = new SmtpClient(smtpServer))
                {
                    smtpClient.Send(mailMessage);
                }
            }
        }

We have multiple options while sending meeting requests. For example “X-MICROSOFT-CDO-BUSYSTATUS:FREE” will set the user state to free even user accept the meeting request. Hope this will help.


SharePoint 2013 Reporting Service Applications – Enable Remote errors for a Reporting services Service Application

We can enable remote errors in for report services installed through SQL Server 2012 in SharePoint or newer versions of reporting services. To enable the service applications we have to set Enable remote error. This will be configured for all the report service applications. To do that we have to follow the steps below,

Navigate to SharePoint central Administration, click on manage service application in Application management section


Select the Service Application in the list of service Applications and Click on the name of Service Application
Click on the System Settings. In Security Section Select "Enable Remote Errors" and click on Ok to Save the Settings.


Friday, April 18, 2014

SharePoint - Back to basics - Display data in groups and sorting in SharePoint data grid view

We can use data view web parts to display data for adding different feature to show our list data. We can display groups and sorting by using data grid view web part. By using grouping sorting options in grid view we can display the item group wise

To add Data View web part to SharePoint page open SharePoint page in designer and in insert tab click on Data View Web part. Add Empty data view web part to the page.



Select the list to add the data view web part by clicking on “Click here to select data source” link in the web part.



We can see the pop up with all the lists in the site. Select the list.


In the right side pane, select multiple view to see all the items in the web part.


We can add/remove the columns to the web part by click on “Add or Remove columns” in the top ribbon. We can sort and group the data by clicking the “Sort and Group” option in top ribbon.



By clicking on the “Sort and Group” option we can see a pop up to add sorting and grouping columns.  We can have the options to collapse and expand the grouping in “Group Properties” section. Also we can edit the sort expression to display the items.



By checking “Sort & Filters on headers” we can provide sorting and filtering options as regular list columns. We can add Grouping tool bar for data view web part by selecting the options tab as shown in the image below.




After all we can see the data with grouping and sorting. 

Thursday, April 10, 2014

SharePoint 2013 wsp upgrading error: Cannot uninstall Language Pack 0 because it is not deployed when attempting to uninstall-spsolution.

While updating a wsp in SharePoint 2013 environment I got an error saying that “Cannot uninstall Language Pack 0 because it is not deployed when attempting to uninstall-spsolution.” As shown the image below.



By checking the solution in farm solutions (Central Administration -> System Settings -> Manage Farm Solutions) Solution wasn’t deployed. I have found this blog explaining the issue. The reason for this error is that DLL’s in the GAC were not able to delete. So I have deleted the DLL’s in the GAC and deployed through SharePoint central Administration

If it is timer job, We have to Stop and SharePoint timer services in the services.

Hope this helps.


Wednesday, April 9, 2014

PowerShell Scheduled Data Refresh – Call to Excel Services Returned an error

In SharePoint Power Pivot data Automatic refresh from excel services, I got an error saying that “Power Pivot Scheduled Data Refresh – Call to Excel Services Returned an error” as shown the image below



By digging into the issue I have found that I don’t have permissions for Power Pivot service. To fix the issue we have to add the permissions for Power Pivot. To add we need to give the account running Power Pivot Full Control to the Web app under the Policy for Web Application.


Hope this helps.

Tuesday, April 8, 2014

SharePoint Usage and Health Data Collection Error - “There is no data available for this report. Here are some possible reasons - Web Analytics has not been enabled long enough to generate data”

While checking the usage health reports for a SharePoint site, I got an Error Saying that “There is no data available for this report. Here are some possible reasons: (1) Web Analytics has not been enabled long enough to generate data; (2) There is insufficient data to generate this report; (3) Data logging required for this report might not be enabled; (4) Data aggregation might not be enabled at the level required for this report.

After checking that one by one in the issues
  • I am having full of data in SharePoint site and that is fair enough to generate the data reports.
  • In the site I am sure that Data logging and Data Aggregation are enabled. I was checked that also as part of trouble shooting. Web Analytic are also enabled as mentioned in the issue.

After pulling hair and digging into the deep, I have found that Usage and Health Data Collection Service Application Proxy has not been started. Silly, but I have spent so much of my time. After starting the service proxy by using following Power Shell command everything working as expected.

$usageHealthDataServiceProxy = Get-SPServiceApplicationProxy | where {$_.DisplayName -eq “Usage and Health Data Service”}
$usageHealthDataServiceProxy.Provision()

Hope this helps.


Thursday, April 3, 2014

SharePoint Power view error: There are no addresses are available for this application

Working with SharePoint power view I got an error saying that “Microsoft.SharePoint.SPEndpointAddressNotFoundException: There are no addresses available for this application.”

Checking the error I have found that we have to run SQL Server Reporting service, Manage metadata service and user profile services. We have to make sure that they are running properly. To do that navigate to SharePoint Central Administration, Application Management section. Click on Manage Services



Check for SQL Server Reporting service, Managed meta data service and User profile services are started or not. If not started Start the services. Reset IIS manager (IISRESET)