Archive

Archive for September, 2008

Promoting Properties – Expose InfoPath Fields as Site Columns

September 29, 2008 7 comments

Well First Let me explain what does it mean by Promotion and Demotion

  • Promotion    –    It means that you capture the value present in the document (*.xml or wordML or you can   write your own document parser) and expose it to the SharePoint document library as a Column. What you get out of it is that you have a synchronization of the Data between the document and Column of the doc library. (When you update the document it gets automatically reflected in the document library and vise versa.) 
  • Demotion        –    It means the opposite. You capture the column of the Document Library and display it in the Document.    

Well whenever you publish a InfoPath form to the SharePoint server using File->Publish, at the end of the Wizard you will be provided

with a Option that will allow you to the add the field of the InfoPath to the document. How can do that when I automation the publishing of the InfoPath using features or When I publish the form using Central Administration Website?. There is an option in InfoPath, where you can specify the fields to be promoted to the Document Library at the design time. Use Tools->Form Option -> Property Promotion

 

 

 

 

Advertisements

Manage Data Connection Files – InfoPath 2007 – Universal Data Connection

September 27, 2008 4 comments

    After going through this article, I got to know the power of Universal Data Connection UDC files in the InfoPath forms and how it helps during multiple deployment and migration scenarios. But what I missed to note is How do I get a Data Connection File from the Central Administration Site – > Manage Data Connection. This article describes how to do that. Also below I have highlighted the points that you need to get a file from Data Connection File from the Central Administration. (Managing the Data Connection Files centrally) with few quick screen clips that will help you.

    Let’s assume that you have created an InfoPath form as per this article. To recap you have added the data connection from the Data Connection Library of your SharePoint site, while doing so you will find an option called Connection Options. Click on the Connection Options and Select the option centrally managed connection Library, by this what you mean is that you are asking the Form template to get the connection file from the Centrally Managed Connection Files from Central admin.

    

    From now on your InfoPath form template will get the Connection Setting from the UDC File of the Central Admin. In case if you want to make any changes to the connection setting all you have to do is to change the Connection File present in the Central Administration Server.

 

References:

http://blogs.msdn.com/infopath/archive/2006/10/02/Data-Connections-in-Browser-Forms.aspx

http://msdn.microsoft.com/en-us/library/ms772101.aspx

http://www.infopathdev.com/forums/t/7653.aspx

http://msdn.microsoft.com/en-us/library/bb267335.aspx

SPPropertyBag

September 23, 2008 Leave a comment

          SPWeb object of SharePoint exposes a Field called Properties which is of type SPPropertyBag a sub class of StringDictionaryIt allows you to store Key value String Data within a web

Below are some quick points that will help you in using it.

  • As Mentioned Before it is a StringDictionary, which can only store String values.
  • You need to call the Update() method of the SPWeb.Properties.Update() to persist the value.
  • Same applies while you are removing a value from it.
  • Below code gives you a quick start.
  • If you want to manage this through UI. Refer this link. It’s a fantastic option you will love.

 using (SPSite oSite = new SPSite(http://mysite))
              {

         using (SPWeb oWeb = oSite.RootWeb)

         {
            //Add an Item to Bag

            oWeb.Properties.Add(“Your Key”,“Your Value”);
            //Be sure to Call the Update Method on Properties

            //If you miss this your value wont get Presisted for the

            //Next Run
            oWeb.Properties.Update();

            // To Reterive the Value

            String sMyItem = oWeb.Properties[“SPPropertyBag”];


            //Remove the Value

            //Be sure to Call the Update Method on Properties
            //If you miss this your value wont get Presisted for the

            //Next Run
            oWeb.Properties.Remove(“SPPropertyBag”);
            oWeb.Properties.Update();

         }
       }

Categories: SharePoint Tags: ,

SPPropertyBag

September 23, 2008 1 comment

SPWeb object of SharePoint exposes a Field called Properties which is of type SPPropertyBag a sub class of StringDictionary. It allows you to store Key value String Data within a web

Below are some quick points that will help you in using it.

  • As Mentioned Before it is a StringDictionary, which can only store String values.
  • You need to call the Update() method of the SPWeb.Properties.Update() to persist the value.
  • Same applies while you are removing a value from it.
  • Below code gives you a quick start.
  • If you want to manage this through UI. Refer this link. It’s a fantastic option you will love.

 

using (SPSite oSite = new
SPSite(http://mysite”))

{


using (SPWeb oWeb = oSite.RootWeb)

{


//Add a Item to Bag

oWeb.Properties.Add(“SPPropertyBag”,“I can Store a StringValue Here”);


//Be sure to Call the Update Method on Properties


//If you miss this your value wont get Presisted for the Next Run

oWeb.Properties.Update();

 


// To Reterive the Value


String sMyItem = oWeb.Properties[“SPPropertyBag”];

 


//Remove the Value


//Be sure to Call the Update Method on Properties


//If you miss this your value wont get Presisted for the Next Run

oWeb.Properties.Remove(“SPPropertyBag”);

oWeb.Properties.Update();

             }

         }

    

    

Categories: Uncategorized

SQL Server and SQL Reporting Server SSRS – Quick Reference –FAQ’s

September 20, 2008 Leave a comment

SQL Server

  1. Add a Database user to a Database role:

        EXEC sp_addrolemember ‘db_owner’, ‘yourdbusername’

        More here

http://technet.microsoft.com/en-us/library/ms187750.aspx?PHPSESSID=rr1g5nuj29l79hrpjk7k0g1461

  1. When you rename the SQL Server name:

In case if you have renamed the SQL Server recently and find a trouble to connect to the server using code. Try the below items.

  • Use Query Analyzer and Connect to the SQL Server.
  • Execute the command SELECT @@SERVERNAME AS ‘Server Name’
  • You will find the old name reflecting there.
  • First run the command sp_dropserver ‘old server name’
  • And then run sp_addserver ‘new server name’, ‘local’
  • You should be good to go

    SSRS Reporting Servers:

  1. To change the User Name or the Server name of the Reporting Server instance [SSRS].
  2. When you get rsreportserverdatabaseunavailable error when connecting to SQL Server Reporting server.

For the above case you have to use the tool rsconfig that will change the user and server details.

http://msdn.microsoft.com/en-us/library/ms162837.aspx

STSADM Tool Reference

September 20, 2008 Leave a comment

Adding Server Side code to the Publishing Page Layouts – PageParserPaths

September 20, 2008 Leave a comment

    This article is to give a brief introduction for the Functionality of PageParserPaths tag in the Web.Config file of SharePoint. (It serves as a Reference for me In future and for someone out there who is  search  for a similar implementation).

    All the Layout pages in the SharePoint 2007 are derived from the class Microsoft.SharePoint.Publishing.PublishingLayoutPage .

This works very well for most of the cases and customization. But there will be very chance that for some reason you want the actual page instance to have a completely different class. Might be a case where you are using a third part tool or a component. In this case if you try to change the base class or put in some custom server side code in to the page layout file, SharePoint will complain you with a parser error.

        This Article describes the approach that will help you to put in the code for the layout pages. It works like charm.

        On additions to the above article is that in case if you are concerned about allowing all the pages having the server code as defined by below tag

<PageParserPath VirtualPath=”/_layouts/masterpage/*” CompilationMode=”Auto” AllowServerSideScript=”true”

IncludeSubFolders=”true”/>

You can make a particular page to have server side code as below

<PageParserPath VirtualPath=”/_layouts/masterpage/yourpage.aspx” CompilationMode=”Auto” AllowServerSideScript=”true”

IncludeSubFolders=”true”/>

While configuring a single page, make sure that you remove the attribute IncludeSubFolders=”true”. If you leave this tag as it is, all you are going to get is a plain HTTP 500 error code which is hard to debug. Validation that SharePoint makes here is IncludeSubFolders=”true” can be present only if the attribute VirtualPath ends with /*.