in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Doug Ortiz's blog

Tales from the SharePoint World
  • List RollUp Web Part - Gratis

     

    En previas publicaciones hemos visto como utilizar Columnas de Sitio para planear, organizar y centralizar nuestros datos en Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007. Hemos visto que cuando se utilizan las Columnas de Sito los datos son accesibles de arriba hacia abajo.

    Asi como los datos son accesibles de arriba hacia abajo, no hay una manera de hacerlo de manera contraria. Con esto en mente, he desarrollado un Web Part que hace lo siguiente:

     

    Sube los datos en Listas en:

    ·         Site Collection

    ·         Sitio y Sitios abajos

    Lo puedes descargar en el siguiente vínculo: http://www.codeplex.com/illustris/Release/ProjectReleases.aspx?ReleaseId=16317

    Sugerencias e ideas son bienvenidas.

     

  • Free List RollUp Web Part

    In previous blog postings we have looked at how to leverage Site Columns to plan, organize and centralize our data across Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007. We have seen that by using Site Columns the data is shared in a Top-Down approach.

     There have been many inquiries about how to accomplish the exact opposite and roll-up data that exists within Lists throughout the Site Collection. With this in mind, I have developed a Web Part that does  the following:

     

    Roll-Up data in Lists in the:

    ·         Site Collection

    ·         Current Site and Below

    It can be downloaded at the following address: http://www.codeplex.com/illustris/Release/ProjectReleases.aspx?ReleaseId=16317

    Feel free to test it; suggestions and ideas are welcome.

    In the next blog posting we will take a quick glance at the Web Part in action.

     

     

  • Visual Studio 2008 Service Pack 1 and .NET Framework 3.5 Service Pack 1 Released!

    All the SQL Server 2008 early adopters have been waiting for this Service Pack because they require prior to installing SQL Server 2008.

    The link below goes through the Overview along witha list of improvements such as:

    • Improvements to WPF Designers in Visual Studio 2008
    • SQL Server 2008 Support
    • Enhanced Ajax and Data Tools
    • Performance increases to WPF based applications ( between 20 - 45% ) without code changes
    • New ADO .Net Data Features
    • TFS Improvements
    • Version Control
    • Work Item Tracking
    • Visual SourceSafe Migration Tool

    and more...

     You can download it at: http://msdn.microsoft.com/en-us/vstudio/products/cc533447.aspx

     

    Posted Aug 11 2008, 03:53 PM by DOrtiz with no comments
    Filed under:
  • Preventing Item Deletions

    I wanted to take a moment to thank all the readers which have contributed to this blog, their comments have been very useful. In fact, this posting is related to a particular situation that many SharePoint Administrators or Site Administrators might encounter when using SharePoint Lists or Document Libraries. The particular situation is when you are using a List or a Document Library to provide data to other depending Lists, Document Libraries, Content Types, etc. It even applies to Site Columns which are a useful way to provide data within your portal.

    In order to prevent Items to be deleted from a List or a Document Library, a few things must happen first:

    • An assembly must have been installed to the Global Assembly Cache ( GAC )
    • An Event Receiver must be attached to the List or Document Library, in particular to the ItemAdding Event

    All these technology terms sound overwhelming, so let’s stop for a moment and explain briefly what we are talking about here. In Windows SharePoint Services 3.0 and MOSS 2007, Lists and Document Libraries have a variety of events that are fired when an Item is processed; to mention a few of the most important ones:

    • ItemAdding
    • ItemUpdating
    • ItemDeleting

    For a complete list go to: MSDN - Event Fundamentals

    Making it simple, we can specify code that will be processed when any of these events happen. This code to executed must be deployed to the GAC ( Global Assembly Cache ), once it is there the next step is to communicate to SharePoint by indicating the following:

    • ClassName, PublicKeyToken, Culture, Version and safety
    • Assembly and ClassName
    • Event to Attach to be attached to
    • Add this information to the SharePoint List or Document Library

    To illustrate this process you will find the following two projects at www.codeplex.com/illustris :

    • Event Receiver Assembly
    • Event Receiver Manager

    These must be downloaded and extracted. Complete the following steps prevent the deletion of items on a desired SharePoint List or Document Library:

    • Deploy assembly ( Demo.ProcessItemDeletion.dll ) contained in the Process Item Deletion project to the GAC
    • Locate the bin/debug folder
    • Open the Command Line

             Ensure you have access to the Visual Studio SDK Tools

    • Install by using the GACUTIL –I –f Demo.ProcessItemDeletion.dll
    •  Execute the Attach / Remove Event Receiver to List or Document Library Utility indicate the following parameters:
    • SharePoint Site URL
    • SharePoint List or Document Library Name
    • ClassName, PublicKeyToken, Culture, Version and safety
    • Assembly and ClassName
    • Click the Add Button

    Once all these steps are completed successfully, any user who is not a Site Administrator will not be able to delete an Item.

     

    Understanding the code

    You are probably wondering what is really happening behind the scenes, and this is the explanation:

    When you install the Demo.ProcessItemDeletion.dll Assembly:

            public override void ItemDeleting(SPItemEventProperties properties)

            {

                base.DisableEventFiring();

                if (!properties.OpenWeb().CurrentUser.IsSiteAdmin)

                {

                    properties.Cancel = true;

                    properties.ErrorMessage = "Items cannot be deleted from this list.";

                }

                this.EnableEventFiring();

            }

    This code does the following:

    • Disables the code to execute recursively
    • Verifies if a Site Administrator is currently logged in
    • Cancels the deletion from happenning
    • Displays the folowing error message: “Items cannot be deleted form this list.”

    When you click the Add Button the following code is executed:

                SPSite oSite = new SPSite(txtSite.Text.ToString());

                SPList oList = oSite.OpenWeb().Lists[txtList.Text.ToString()];

                oList.EventReceivers.Add(SPEventReceiverType.ItemDeleting, txtAssemblyName.Text.ToString(), txtClassName.Text.ToString());

                oSite.Dispose();

    This code does the following:

    ·         Opens the URL specified in the TextBox

    ·         Opens the List or Document Library specified in the TextBox

    ·         Communicates to SharePoint and tells it to execute the code in the previously installed assembly when the ItemDeleting Event is fired

     

    Where to go from here?

    That really depends on you, mostly because you can expand this code and make it more functional. For instance, you could provide a more detailed explanation of why the user could not delete the item. Or maybe you want to apply the same idea to updating items as well ( which would require the development of code in the Demo.ProcessItemDeletion project for the ItemUpdating Event ).

    The whole purpose of this posting is to ignite ideas that will help you customize your portal to better fit your needs.

     

  • Will be back after a much needed Vacation!

    Thought it would be prudent to let you all know that after some hectic days really needed

    some down time.

     

    I will be back with a new posting at the end of May 2008.

     

  • Displaying and Filtering Lists in another SharePoint Site with SharePoint Designer 2007

    By popular demand, I am dedicating this posting to the avid readers of the blog.

    As mentioned in the title, we will be addressing how to display and filter ListItems

    contained in another SharePoint Site by using SharePoint Designer 2007.

     

    This is a very easy way to maximize the use of a powerful tool such as SharePoint

    Designer 2007 is for SharePoint Technologies. Now, let's start customizing:

    Connecting to another library

    • Open SharePoint Designer 2007
    • Click File -> Open Site
    • Enter the URL of the SharePoint Site that we will customize
    • Click the default.aspx Page
    • Scroll down to the bottom of the TreeView
    • Click the Connect to another library Link
    • Click the Add Button
    • Enter the Display Name for the Site
    • Enter the URL of the SharePoint Site
    • Click OK Button
    • Click OK Button

    Adding and Displaying the SharePoint List with the Data View Web Part

    • Position the cursor where we desire the Data View Web Part to be displayed
    • Click Insert -> SharePoint Controls -> Data View on the SharePoint Designer Top Menu
    • Click the Data Source Library Tab located at the right corner of SharePoint Designer Toolbox
    • Expand the Node corresponding to the recently created connection to another SharePoint Site
    • Expand the Node named SharePoint Lists
    • Hover over the desired SharePoint List to display
    • Click the Show Data Link
    • Select the SharePoint List Columns to display
    • Drag and Drop them onto the Data View Web Part
    • Click the Save Button on the SharePoint Designer 2007 Top Menu Toolbar
    • A Message Box indicating that the current SharePoint Site will be customized is displayed
    • Accept and Continue
    • Refresh the Browser
    • The SharePoint List is now displayed

    Filtering the SharePoint List with the Data View Web Part

    • Click the Data View Web Part
    • Click the > Button
    • Click the Filter Link
    • A Filter Criteria Box is displayed
    • Click the Click here to add a new clause Link
    • Select from the Dropdown the Field Name to be used for filtering
    • Select the desired value in the Comparison Dropdown
    • Select the filtering value in the Value Dropdown
    • Click OK Button

    While this approach easily accomplishes the tasks of displaying and filtering a

    SharePoint List from another SharePoint Site, it can become an administration inconvenience

    for a SharePoint Administrator in a scenario in which multiple sites will require a specific filter

    for the SharePoint List.

    Enjoy!

  • WSPBuilder Extensions v 1.01 Released

    Tom Clarkson uploaded on March 11, 2008 a new release of WSPBuilder.

    In a previous blog posting we quickly glanced at WSPBuilder, with this new Release 1.01 there are a few niceties added:

    • WSPBuilder Template Project
    • Two new useful Tasks when right clicking the Project:
      • Create Deployment Folder
      • Attach to IIS Worker Processes

    Besides the WSPBuilder Project and WSPBUilder Project with Workflow Templates available for Visual C#, a new one has been added:

    0501012008 - WSPBuilder Project Templates

     

    When Right-Clicking the project two new additional task items are available:

     0502022008 - New Tasks

    I encourage you to download and review the features of WSPBuilder.

    WSPBuilder Extensions 1.01 is available for download at: http://www.codeplex.com/wspbuilder.

     There are more details regarding the new additions by clicking on the Releases Tab at codeplex.

  • Displaying Concatenated Columns in a Calendar View

    Sometimes, the need to display columns that contain values from other

    existing columns in a SharePoint List arises. For those times, a quick and easy

    solution is to create a calculated column that will contain the columns we desire

    to display.

     

    A real world example for using a Calculated Column that comes to mind is in a

    Calendar View ListItem: Merging the Title Column with the Date and Time of the ListItem.

    This can easily be accomplished by creating a calculated column that concatenates the

    values in those columns.

     

    For this example, we will assume you already created a standard Calendar List. Under the

    Calendar List Settings of your List:

    • Click Create column
    • Set the Column name: to: TitleAndDate
    • Select the Calculated (calculated based on other columns) Radio Button
    • In the Formula: Text Box type:

    =Title & " " & TEXT([Start Time],"mmm-dd-yyyy")

    • Select the Single line of text Radio Button for The data type to be returned from this formula is:
    • Click OK Button

    In order to displaying the newly created TitleAndDate Column in the Calendar View, we

    must modify the Calendar Columns View and set:

    • Month View Title
    • Week View Title
    • Day View Title

    DropDowns to: TitleAndDate

    • Click OK Button

    The end result will display the Title and the Start Date separated by a space.

    Before  After 
    Before   After

    Reviewing the Formula

    The magic occurs in the TEXT function that converts the Start Time Column into text,

    followed by the text being formatted into "mmm-dd-yyyy".

     

    In case you need to add the time, just replace "mmm-dd-yyyy" with "mmm-dd-yyyy HH:MM:SS".

     

     

  • Leveraging the use of Site Columns – Part II

    In the previous blog posting we explored how to use Site Columns to propagate data throughout a Site
    Collection. Now it is time to take it a step further, this time instead of saving the data within the Site
    Column we will reference the data stored in a SharePoint List named Company Departments. We will
    quickly create the SharePoint List, populate it and create the Site Column referencing the SharePoint List.

     

    1. Let's create the SharePoint List:
      • Click on the List Links on the left hand Navigation Bar
      • Click the Create Link on the Menu Bar
      • Click the Custom List from the Custom Lists Group
      • Set the Name to Company Departments
      • Select the Yes Radio Button choice from the Display this list on the Quick Launch?
      • Click the Create Button
    2. Populate the Company Departments SharePoint List:
      • Click the New Link on the Menu Bar
      • Set the Title Textbox to: Finances
      • Click OK Button
      • Click the New Link on the Menu Bar
      • Set the Title Textbox to: Human Resources
      • Click OK Button
    3. With our SharePoint List created we must create a Site Column that references the newly created
            Company Departments SharePoint List
    • Click on the Site Actions link on your site
    • Click on the Site Settings option
    • Click the Site columns link in the Galleries Group
    • Click the Create Link
    • Set the Column name to List Based Company Departments
    • Set the Type to Lookup (information already on this site)
    • Either choose Custom Columns from the Existing Group Drop Down or set the name
              for the New group, for this example we will use the Company Wide group name
    • Decide if it is Required that this column contains information, it is recommended to set it to Yes
    • Select from the Get information from: DropDown the Company Departments SharePoint List
    • Select the Title (linked to item) choice from the In this column: DropDown
    • Click OK Button

    We are ready to put the List Based Company Departments Site Column in action! To use the newly

    created Site Column we will create a SharePoint List named Employees and a required Column
    named Company Departments that will use the Site Column by clicking on the Add from existing
    site columns
    link as shown below:

    Add from existing site columns

    The next screen will be the following:

    Add Columns from Site Columns 

    • Select the Company Wide group or the name you assigned to the Site Column from the Select
              site columns from: Drop Down
    • The List Based Company Departments Site Column will be display in the Available site columns
              ListBox
    • Click the Add Button
    • Click OK Button

    You are right ahead of me, our next steps involve testing that our Site Column works properly. For this purpose
    we will attempt to create a new Employee:

    Site Column being used 

    As expected, the Finances and Human Resources Departments are listed in the DropDown. Go ahead
    and add the Information Technology Department to the Company Departments SharePoint List created
    previously and proceed to create a new Employee again. As you can see below, the newly item is
    displayed in the DropDown.


    New Choice in Site Column 

    Comparing both methods of Site Columns Creation

    While both methods accomplishes the same, there is a major difference between them:

    The previous method requires either a SharePoint Administrator(s) or a User(s) with enough permissions to
    update the Site Column every time that an update is required. 

    The current method enables the SharePoint Administrator(s) to assign permissions to User(s) that can maintain
    those SharePoint List(s).

    Depending on the amount of updates that are required, the first method could become problematic in
    environments in which a single person is the SharePoint Administrator along with other responsibilities
    that already have been assigned to that position.

     

  • WSPBuilder Extensions v 1.0.0 Release Candidate Released

    WSPBuilder Extensions is an add-in that works with Visual Studio 2005 and Visual Studio 2008, developed by Carsten Keutmann with help from Tom Clarkson who developed the Visual Studio Templates. Thanks to them, SharePoint Development will not have to be as time consuming or cumbersome as it used to be.

    WSPBuilder Extensions is a welcome competitor to the Windows SharePoint Services 3.0 Tools: Visual Studio Extensions which has not been updated since the release of Visual Studio 2008. Using the WSPBuilder for development simplifies coding by:

    • Eliminating the need to create a manifest.xml file, it does automatically for you!
    • Creating and Naming the WSP solution file based on the manifest.xml file created by the tool itself. The naming is based on the name of the folder in which the project resides
    • Providing the following useful Tasks:
      • Build WSP
      • Deploy
      • Upgrade
      • Uninstall
    • Copy a file to the 12 hive
    • Recycling the AppPools from the Visual Studio interface!

     

    WSPBuilder Extensions installs two Visual Studio templates that are available only for Visual C#:

    WSPBuilder Visual Studio Templates 

    When Right-Clicking the project an additional item is added with the following tasks:

    WSPBuilder Add-In Tasks

    While it does not do everything for you ( no tool does! ), it certainly is re-defining and setting the standards higher. Hopefully, this posting will spark SharePoint Developers interest to take a look at WSPBuilder Extensions. A big plus is that it's free!

    WSPBuilder Extensions is available for download at: http://www.codeplex.com/wspbuilder.

  • Leveraging the use of Site Columns – Part I

    Site Columns is a topic that is not discussed nor mentioned very much, in my opinion it should be discussed more often because by leveraging Site Columns throughout a Site or Sites; you can standardize, create, maintain and share the data in those List Columns easily. This is a two part series posting, make sure you check later for the second part.

    Most of the time, when the design and creation of SharePoint Lists occurs some columns are needed to be of the Type: Choice. This is a very nice way of limiting the user input, while allowing the designer to determine the display choices ( Drop-Down Menu, Radio Buttons or Checkboxes ). SharePoint Sites are created and most of the time the Columns in the Lists of that Site can or will be created from scratch on another SharePoint Site. This process repeats itself many times through the portal; it happens frequently between Site Administrators due to the lack of communication or simply because it is not known that there is the possibility of using central repository of Columns that can be shared across sites.This is where using Site Columns becomes a Site Administrator’s best friend, for example most companies will at some point in time have a SharePoint List Column that contains all the departments. The most common approach is to just create the SharePoint List with a Column of the Choice Type and add those values manually. This is a valid approach, but can you imagine how much easier it would be if you simply chose a pre-existing Column that contains those values already? Take it a step further and for a moment imagine how many times this type of Column might be duplicated with a Site or throughout the SharePoint Portal itself. Makes you wonder, does it not?Before creating a Site Column it is important to determine which Sites it will be shared with. If you would like it to all the sites under a Top-Level site or just within a specific Site. After that has been determined we can move on and start creating a Site Column.Creating a Site Column is accomplished with the following steps:

     

    •  Click on the Site Actions link on your site
    • Click on the Site Settings option
    •  Click the Site columns link in the Galleries Group
    • Click the Create Link
    • Set the Column name to Company Departments
    • Set the Type to Choice
    • Either choose Custom Columns from the Existing Group Drop Down or set the name for the New group, for this example we will use the Company Wide group name
    • Decide if it is Required to contain information
    • Enter your Companies Departments, in this case:
      • Finances
      • Human Resources
    • Choose the Display choices
    • Click OK Button

     

    Your Site Column is ready to be placed in action! To use a Site Column on any SharePoint List you create, it must be added by clickin on Add from existing site columns link as shown below:

     

    Once clicked, you will see the following screen:

     
    • Select the Custom Columns group or the name you assigned to it from the Drop Down
    • The Company Departments Site Column will be display in the Available site columns ListBox
    • Click the Add Button
    • Click OK Button

     

    After you have created your Employee List that references the Company Departments Site Column it will be displayed as a DropDown, as shown below:

     

     

    You are probably wondering: How does the Site Column really help? It helps by simplifying the process of maintaining the choices that exist in the Site Column that was created. For some reason, you forgot to add the IT Department as a choice in your Site Column. So you go back and add it:

    • Navigate to the Site where the Site Column was created in
    • Click on the Site Actions link on the site where the Site Column was created
    • Click on the Site Settings option
    • Click the Site columns link in the Galleries Group
    • Scroll down and Locate the Company Wide Group
    • Click on the Company Departments Site Column Link
    • Scroll down to the Additional Column Settings section
    • Add the Information Technology as another Choice
    • Click OK Button

     

    Go to the Employees List and Add a New Employee, the newly added Information Technology choice is included.

    Summing it all up

    Briefly, Site Columns will propagate automatically without the need of updating each and every list that references the Site Column(s) in use. That is where the usefulness of Site Columns comes in handy; it will make life easier for a SharePoint Administrator.Stay tuned for Part II, we will take the Site Column we just created a step further!
  • Possible glitch in SharePoint Designer Service Pack 1

    By now, almost everyone has heard about the release of Service Pack 1 for the following Office Products:

     

    Before opening a SharePoint Site did notice that the "HTML Editor" option in Internet Explorer was set to "Microsoft Office Word". Fixed this problem with the following steps:

    • Click inside Internet Explorer the "Tools" Toolbar dropdown
    • Click "Internet Options"
    • Click "Programs" Tab
    • Set the "HTML editor" dropdown to: "Microsoft Office SharePoint Designer"
    • Click "OK"

     

    So far everything has worked without a problem after the installation of Service Pack 1, with an unexpected faster response from SharePoint Designer.

  • Developing a Custom Web Part with Microsoft Visual Studio 2008

    With the release of Microsoft Visual Studio 2008 many SharePoint Developers will be interested in creating custom Web Parts for SharePoint. This is entirely achievable and not very different from how it is done within Visual Studio 2005.

    While the avenues to accomplishing this are similar with Microsoft Visual Studio 2005, there are a few items to consider:

    • ·         Visual Studio 2005 Extensions for Windows SharePoint Services is not available or compatible with Microsoft Visual Studio 2008
    • ·         As a good practice, it is recommended to backup your project before converting it into Visual Studio 2008

    Creating the Web Part Project can be done in two of ways:

    1. ·         Convert an existing template project from Microsoft Visual Studio 2005
    2. ·         Create the project from scratch

    o   Add the following references to the project:

    System.Web;

    Microsoft.SharePoint

    o   Add the following code to the top of the project

    using System.Web;

    using System.Web.UI;

    using Microsoft.SharePoint.WebPartPages;

    o   Assign the class to inherit from the WebPart

    public class MyCustomWebPart: WebPart

    o   Add the RenderWebPart code:

    protected override void RenderWebPart(HtmlTextWriter output)

    {

    }

    o   Add desired code inside the “RenderWebPart”

    o   Determine deployment type: bin or Global Assembly Cache

    o   By default the Target Framework is 3.5

    o   Deploy the Custom Web Part

  • Should I Use Visual Studio 2008 as my only development environment for SharePoint?

    Should I Use Visual Studio 2008 as my only development environment for SharePoint

    Visual Studio 2008 was Released To Manufacturing this past November 19, 2007, by now a multitude of SharePoint enthusiasts have most likely downloaded or installed it on their development environments.

    They probably are wondering whether to keep the current install of Visual Studio 2005 or not; this is the purpose of this posting to help you assess whether or not you should un-install Visual Studio 2005 and use solely Visual Studio 2008 for your development environment.

    These are the issues to consider:

    • Visual Studio 2005 Extensions for Windows SharePoint Services 3.0 does not work in conjunction with Visual Studio 2008.

                The node for SharePoint does not exist when creating a new project, even if you un-install and re-install the Visual Studio 2005 Extensions for Windows SharePoint Services 3.0.

    • Visual Studio does include under the Office 2007 Node the following workflows:
      • SharePoint 2007 Sequential Workflow
      • SharePoint 2007 State Machine Workflow
    • Visual Studio 2008 allows you to choose your target Framework
    This is accomplished by going to the Project properties in the Application Tab, a dropdown named TargetFramework is now available

    Conclusion

    While the development of Custom Web Parts, Site and List Definitions for SharePoint does not exclusively depend on Visual Studio 2005 Extensions for Windows SharePoint Services 3.0, it is not readily available in Visual Studio 2008.

    Therefore, if you do not use the VSE for WSS you can go ahead and un-install it. Otherwise, you might have a use for it if using Visual Studio 2005 Extensions for WSS once in a while.

  • Welcome to my SharePoint Blog

     Hello all to my first posting.

     We will be looking at interesting blogs related to SharePoint.

     
    Stay tuned!
     


Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts