Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all 25064 articles
Browse latest View live

System Center Service Manger with SharePoint 2010

$
0
0

Hello,

we would like to install the Service Manager 2012. What do I need for installing this? At first I would to use just the Incident Manager alone. What Do I need to install this?

Best regards

Matthias


Unable to extract custom managed property value inside ResultTableCollection in ResultScriptWebPart

$
0
0

Hi,

I am having an issue extracting values inside the ResultTableCollection after executing a query. I have extended the ResultScriptWebPart and delegated the QueryIssuing event.

I am getting an error like Column "CustomManagedProperty1" does not belong to table items. If I access "Title" inside the result table, it does not give me this error.

Any feedback is greatly appreciated. Thanks!

Set Custom Master Page for all new subsites

$
0
0

Greetings Everyone,

I am currently poking through SharePoint Server 2013 (Enterprise) working to customize it for my agency's needs and I am running into a slight roadblock.  I have a custom master page.  I can get it to apply to my site and all subsites, however when I create a new subsite on Sharepoint it does not seem to be inheriting my custom master page.  I know it's possible to go in and make it reset and inherit for all subsites, but I will be having people who know even less than I do create subsites and I don't want to make them have to go through the process of resetting the master page.

What should I be looking at or what can I do to make it the default so that whenever a subsite is created it will automatically pick up my custom master page.

Thanks in advance for any help you can provide.

Parth

Save Excel File to sharepoint O365 using save and saveas in windows service

$
0
0

Hi team,

We deployed a windows service used to save excel file to o365.

Now we're using the method save() and saveas() to accomplished this.

But we're not able to handle the case in the following condition:

Save File from local to SharePoint o365 use saveas() method and the target file has been opened by another user.

In this case, it should return some error like: The file is opened by another process.
But the problem is we're not getting any error in try-catch sentence and when we get an upload error notification in sharepoint upload center. Any method for this to get the error info in the log (Simplest way prefered)?

Sample code:

string tgtPath=https://contost.sharpoint.com/teams/Test/Shared Documents/

try{

....

 eBook.SaveAs(tgtPath);

}

catch{

}

Cannot implicitly convert type 'int' to 'DocumentFormat.OpenXml.StringValue'

$
0
0

Hi,

I have a write code-behind in infopath form to convert word document using openXML

Below code i have used to convert:

I underlined the code which is getting error!!!

using Microsoft.Office.InfoPath;
using System;
using System.Xml;
using System.Xml.XPath;
using System.IO;
using System.Text;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;


namespace SampleForm
{
    public partial class FormCode
    {
        // Member variables are not supported in browser-enabled forms.
        // Instead, write and read these values from the FormState
        // dictionary using code such as the following:
        //
        // private object _memberVariable
        // {
        //     get
        //     {
        //         return FormState["_memberVariable"];
        //     }
        //     set
        //     {
        //         FormState["_memberVariable"] = value;
        //     }
        // }

        // NOTE: The following procedure is required by Microsoft InfoPath.
        // It can be modified using Microsoft InfoPath.
        private TableCell createCell(string content)
        {
            // Create a new table cell
            TableCell tc = new TableCell();

            // Specify the width of the table cell
            TableCellWidth tcw = new TableCellWidth();
            tcw.Width = 2400;
            tcw.Type = TableWidthUnitValues.Dxa;
            tc.Append(new TableCellProperties(tcw));

            // Specify the content of the table cell
            tc.Append(new Paragraph(new Run(new Text(content))));

            // Return the new table cell
            return tc;
        }

        private TableRow createRow(string cell1, string cell2, string cell3)
        {
            // Create a new table row
            TableRow tr = new TableRow();

            // Add the table cells to the table row
            tr.Append(createCell(cell1));
            tr.Append(createCell(cell2));
            tr.Append(createCell(cell3));

            // Return the new table row
            return tr;
        }
        public void InternalStartup()
        {
            ((ButtonEvent)EventManager.ControlEvents["CTRL6_5"]).Clicked += new ClickedEventHandler(CTRL6_5_Clicked);
        }

        public void CTRL6_5_Clicked(object sender, ClickedEventArgs e)
        {
            // Write your code here.
            // Get a reference to the main data source
            XPathNavigator root = MainDataSource.CreateNavigator();

            // Copy the template and create a new document
            string newFilePath = @"C:\NewDoc.docx";
            File.Copy(@"C:\QuickQuote.docx", newFilePath, true);

            using (WordprocessingDocument myDoc =
            WordprocessingDocument.Open(newFilePath, true))
            {
                // Add an aFChunk part to the package
                string altChunkId = "AltChunkId1";
                MainDocumentPart mainPart = myDoc.MainDocumentPart;
                AlternativeFormatImportPart chunk = mainPart
                .AddAlternativeFormatImportPart(
                AlternativeFormatImportPartType.Xhtml, altChunkId);

                // Retrieve the rich text field contents
                // and store it into the aFChunk part
                StringBuilder sb = new StringBuilder();
                sb.Append("<html>");
                sb.Append(root.SelectSingleNode(
                "//my:RtxtField", NamespaceManager).InnerXml);
                sb.Append("</html>");
                string html = sb.ToString();

                using (MemoryStream ms =
                new MemoryStream(Encoding.UTF8.GetBytes(html)))
                {
                    chunk.FeedData(ms);
                }

                // Add the aFChunk to the document
                AltChunk altChunk = new AltChunk();
                altChunk.Id = altChunkId;
                mainPart.Document.Body.Append(altChunk);

                // Create an empty table and specify formatting for its borders
                Table table = new Table();
                TableBorders borders = new TableBorders();

                TopBorder tb = new TopBorder();
                tb.Val = new DocumentFormat.OpenXml
                .EnumValue<BorderValues>(BorderValues.Dashed);
                tb.Size = 24;
                borders.AppendChild<TopBorder>(tb);

                BottomBorder bb = new BottomBorder();
                bb.Val = new DocumentFormat.OpenXml
                .EnumValue<BorderValues>(BorderValues.Dashed);
                bb.Size = 24;
                borders.AppendChild<BottomBorder>(bb);

                LeftBorder lb = new LeftBorder();
                lb.Val = new DocumentFormat.OpenXml
                .EnumValue<BorderValues>(BorderValues.Dashed);
                lb.Size = 24;
                borders.AppendChild<LeftBorder>(lb);

                RightBorder rb = new RightBorder();
                rb.Val = new DocumentFormat.OpenXml
                .EnumValue<BorderValues>(BorderValues.Dashed);
                rb.Size = 24;
                borders.AppendChild<RightBorder>(rb);

                InsideHorizontalBorder ihb = new InsideHorizontalBorder();
                ihb.Val = new DocumentFormat.OpenXml
                .EnumValue<BorderValues>(BorderValues.Single);
                ihb.Size = 24;
                ihb.Color = new DocumentFormat.OpenXml.StringValue("#FF0000");
                borders.AppendChild<InsideHorizontalBorder>(ihb);

                InsideVerticalBorder ivb = new InsideVerticalBorder();
                ivb.Val = new DocumentFormat.OpenXml
                .EnumValue<BorderValues>(BorderValues.Dashed);
                ivb.Size = 24;
                borders.AppendChild<InsideVerticalBorder>(ivb);

                TableProperties tblProp = new TableProperties(borders);
                table.AppendChild<TableProperties>(tblProp);

                // Loop through the repeating table and create rows in the table
                XPathNodeIterator iter = root.Select("//my:group2",
                NamespaceManager);
                while (iter.MoveNext())
                {
                    string cell1 = iter.Current.SelectSingleNode(
                    "my:cell1", NamespaceManager).Value;
                    string cell2 = iter.Current.SelectSingleNode(
                    "my:cell2", NamespaceManager).Value;
                    string cell3 = iter.Current.SelectSingleNode(
                    "my:cell3", NamespaceManager).Value;

                    TableRow tr = createRow(cell1, cell2, cell3);
                    table.Append(tr);
                }

                // Add the table to the document
                mainPart.Document.Body.Append(table);

                // Save the document
                mainPart.Document.Save();
            }
        }
    }
}

Customize the timeline

$
0
0

What I basically want is to show the timline with only the main task(s). When the user click on i.e. a plus sign next to the task, it will expand and show the sub tasks.

Kind of like how it is done in the task list, where you click the main task, and then the sub tasks are displayed.(expanded)

Can this be done only by using CSS, display:true/false?

Any help, would be very much appreciated.

missing -- SQL Server Reporting content types in a site collection...

$
0
0

SharePoint 2013 farm setup:
SP server --> SharePoint 2013 farm, powerpivot working, added SSRS features under shared items in the SQL Installation on the SharePoint server.

SQL server has all content databases.

Perform a new Installation of SQL server 2012 on the SharePoint server.
SQL Server Feature installation 
Reporting services Add-in for SharePoint Products 
Restart server 
Open SharePoint Admin Powershell 
 Install-SPRSService
 Install-SPRSServiceProxy
 get-spserviceinstance -all |where {$_.TypeName -like "SQL Server Reporting*"} | Start-SPServiceInstance
Create SQL Server Reporting Services Service application

Settings -> Advanced settings -> Allow management of content types
Site collection features: Activate Report Server Integration features

Still the content types do not show up.

Sharepoint 2013 Forms Auth Session is null

$
0
0

Hi,

I have a custom login page for sharepoint 2013. When i logged in and redirected another page, the session object is null.

My auth code :

bool IsAuthenticated = SPClaimsUtility.AuthenticateFormsUser(Context.Request.UrlReferrer, txtUserId.Value, txtPassword.Value);

if(IsAuthenticated )

{

Session["UserInfo"] = "aaaaa";

Response.Redirect(@"/SitePages/Home.aspx", false);

}

In Home.aspx Session["UserInfo"] is null.

How can solve this problem,

Thank you..


Page redirection issue in javascript when the redirect URL has hash value

$
0
0

Hi,

While redirecting to a new page using javascript redirect, page redirection is not happening instead the same page is reloading, when the browser url contains hash and the value passed in the browser after hash is turncated and on second time click the page redirection is happening. Kindly let me know if someone came across this issue and resolved the same.

Eg: Browser url "http://bing.com?&a=0#abcd" will be changing to "http://bing.com?&a=0#" after first click of javascript click event which should do page redirect but which is not happening and on second click of javascript click event page redirection is happening but the browser url is "http://bing.com?&a=0#"

Thanks in advance.....

SharePoint 2013 - How to Get Document Library Size

$
0
0

We have this Document Library Monitoring Console App written in C# and its running in SharePoint 2007. We now upgrading our SharePoint Server to 2013, so we also need to upgrade our solutions and customization including console apps.

I search through the web I can't find replace for deprecated "SPSite.StorageManagementInformation".

Please help.

Workdlow Designer: How to set permissions based on lookup fields

$
0
0

Hello,

I'm trying to solve of giving permissions problem and I wonder if I can do that using SP designer and not an event receiver.

I have two lists, The list "A" that has two fields:"Title" and a "user" field where you can put SP groups. The list B has a description and a multi-select lookupfield to list lookup.

The request is that when a user creates an item in list B (and selects value from the lookup field in list A), the workflow will give permissions to the item, only on SP groups in user field.

I'm missing how to deal with multi-select field. I mean, what do I have to make iterations on the lookup field and set the permissions. 

Thank you


Christos

RSS Viewer doesn't work in SP 2013 publishing pages

$
0
0

Hi,

I have SharePoint 2013 site with Publishing enabled. When I add RSS Viewer to a page and save, it works well (still unpublished). When I publish the page it doesn't load the RSS Viewer. Progress bar is moving continuously but no outcome.

I have dug out the internet for a proper solution but couldn't find any. A proper solution or reason from the community is much appreciated.

Thanks.

LK

Folder name already exists error when activating feature

$
0
0

HI,

I am creating a document library and adding folders to it using elements.xml in VS 2012.

First time deployment of the item works fine, the folder is created. But further deployment or activation of feature from site features is throwing the error "Folder name already exists".

Below is the elements.xml of List Instance, which was modified to add the folders.

<ListInstance Title="TestLibrary" OnQuickLaunch="FALSE" TemplateType="101" FeatureId="Guid" Url="Lists/TestLibrary" Description="TEST Library List Instance"><Data><Rows><Row><Field Name="ContentTypeId">0x0120004F994A3C0FF76546A528DA0D4B515898</Field><Field Name="FileLeafRef">Test_One</Field><Field Name="Title">Test_One</Field><Field Name="FSObjType">1</Field></Row><Row><Field Name="ContentTypeId">0x0120004F994A3C0FF76546A528DA0D4B515898</Field><Field Name="FileLeafRef">Test_Two</Field><Field Name="Title">Test_Two</Field><Field Name="FSObjType">1</Field></Row></Rows></Data></ListInstance>

How to fix this?

Thanks

Open Link in new window, when field or column type is of Hyperlink

$
0
0

Hi

I have created a column by name Registration of 'Hyperlink or picture' type, and i want to open the link entered by the user in the new window as it is opening in the same window by default.

Please help its a very major requirement.

Thanks

Paru

workflow error in shrepoint2013

$
0
0

System.InvalidOperationException: Operation failed with error Microsoft.Workflow.Client.WorkflowManagementException: A response was returned that did not come from the Workflow Manager. Status code = 503:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Service Unavailable</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Service Unavailable</h2>
<hr><p>HTTP Error 503. The service is un

i am facing above error

i have started workgflowmagmntpool in iis application pool.

and again it is stopping when i am trying to publish the workflow

in event viewer i have got an error that sql server agent(sharepoint) is stopped.

after that i have strted both sql server agent and workflowmgmntpool services.

after that also when i publish workflow it is not working and giving same error.

but OOB workflows are publishing.


Can I get the value for community site's What's Happening web part with Powershell?

$
0
0

I need to generate some statistic reports for our SP2013 community site. Some of figures I need are "no. of discussion", "no. of replied" and "no. of members" which are already listed in the "What's Happening" web part.

Can I directly get this counters with PowerShell instead of calculating from "Discussion Board List"?

Append text in one of the fields of the search results using ResultScriptWebPart

$
0
0

Hi,

I have extended ResultScriptWebPart and would like to update the fields with a constant value based on a backend logic.

QueryIssuing -> Event

// After ExecutyQuery()
         var resultTables = resultTableCollection.Filter("TableType", KnownTableTypes.RelevantResults);           
            foreach (ResultTable item in resultTables)
            {
                int count = item.Table.Rows.Count;
                DataRow row = null;
                for (int i=0; i<count; i++)
                {
                    item.Table.Rows[i]["Flag1"] = "This field is updated."                    
                }                

                     resultCollection.Add(item);

         e.Result = resultCollection

In my search display template, I added "Flag1" into my ManagedProperty mapping but the value still blank. Can it be done this way? 

Any feedback is greatly appreciated. Thanks.


Sharepoint Web Part Quick Action Toolbar displaying differently for various users

$
0
0

We are running into a weird issue on a client site that I have been unable to find a solution for. We have a few web parts for document libraries on the page, and the quick action toolbar is different depending on the user. Some of our users see this:



While other users see this:

Since it was varying on user, we initially thought it would be permission based, however, as the admin we have more permissions than any of the users and we see the "new document or drag..." option. Some of the users with the same permissions are also getting different views. Any ideas on why this would display differently for different users?

Sharepoint 2013 provided hosted app with FBA authentication

$
0
0

Hi all

First time writing here (in desperation and as a last resort).

For one of our client, I need to create a prototype for a SharePoint 2013, provider-hosted, MVC App hosted On-Premisses.

The app must use FBA for authentication and is hosted, for the moment, on a demo environment (Windows Server 2012 + SharePoint 2013 Enterprise edition). I'm using Visual Studio 2013 Premium for development.

The problem is that I'm unable to authenticate, from inside the application, using FBA. If I'm using Windows identity, the application is authenticating the user without problems and the FBA was tested by accessing the site collection directly.

I've notices that the TokenHelper class inside the application is enabled only for Windows claims. So, the question is:

Is it even possible to use FBA with MVC App hosted On-Premisses? And I mean without re-factoring the entire SharePoint 2013 server.

Thank you in advance

Ionut

How to get user input during workflow process?

$
0
0

Hi,

I've been trying to transfer document from one document library to another. Here, I need to change my file name with user input. This process is a manual process that on clicking of top ribbon option it will be moved to destination library. How can I get the user input during workflow or how to prompt the popup for getting input? Is there an alternative method of getting user input during a Workflow process?

Please help me to resolve this issue. Your help would be appreciated.


Thanks., Prakash

Viewing all 25064 articles
Browse latest View live


Latest Images