My 2p about ERP Solutions, Information Worker Solutions and other software products (mainly Microsoft Dynamics AX and Microsoft SharePoint).

31 March 2008

Bar Graphs in SharePoint

I ran into a great blogpost by Paul Galvin about creating bar graphs in SharePoint by use of the Data View Web part. You just need some knowledge about tweaking the XSLT.

Must read for anybody wanting to make graphical overviews of data in SharePoint lists with status columns for your manager.


Continue reading......

by Patrik Luca 0 comments

24 March 2008

Extension to the Rooms and Equipment Reservation application template

Business Scenario


You have set up the Room and Equipment Reservations application template. Some resources are created, for example:
  • Resource Name: Conference Room 1; Resource Type:Conference Room
  • Resource Name: Conference Room 2; Resource Type:Conference Room

Some of your end-users start creating reservations, for example:
  • Start Date: 24-03-2008 1 PM 00
  • End Date: 24-03-2008 3 PM 30
  • Resource: Conference Room 1

Those users would like to send out an appointment with Microsoft Outlook right away from within SharePoint, taking into account the data they have already provided upon creation of the reservation in SharePoint.

Solution


To achieve this, I combined some of my SharePoint knowledge, with a Javascript snippet I found on the web written by Brian White.

As prerequisite for the solution, Microsoft Outlook should be installed on the client machine with which the SharePoint site is being accessed.
  1. Open the MyReservations.aspx page with Microsoft SharePoint Designer 2007.
  2. Right-click the ListViewWebPart and choose Convert to XSLT Data View.

     
  3. Right-click the last column of the created grid, and choose Insert -> Column to the Right
  4. Give the column the title Outlook Appointment.
  5. Go to the code view.
  6. Insert right after the PlaceHolderMain tag following code snippet:
    <script type="text/javascript">

    function createOutlookAppointment(title,meetinglocation,startdate,enddate)
    {

    newAppt = new appt(title, meetinglocation, formatIncomingDateTime(startdate),
    formatIncomingDateTime(enddate));

    saveAppt( newAppt );
    }
    function formatIncomingDateTime(incomingDateTime){

    var datePart = incomingDateTime.substring(0,10);
    var timePartHours = incomingDateTime.substring(11,13);
    var timePartMinSecs = incomingDateTime.substring(13,16);

    timePartHoursInt = parseInt(timePartHours,10) + 1;
    timePartHours = timePartHoursInt.toString();
    return datePart.concat(' '.concat(timePartHours).concat(timePartMinSecs));
    }

    function appt( Subject, Location, Start, End){

    this.Subject = Location;
    this.Location = Location;
    this.Start = Start;
    this.End = End;


    this.ReminderMinutesBeforeStart = 15;
    }
    function saveAppt( obj ){

    var olAppointmentItem = 1;

    out = new ActiveXObject( "Outlook.Application" );

    appt = out.CreateItem( olAppointmentItem );

    appt.Subject = obj.Subject;
    appt.Location = obj.Location;
    appt.Start = obj.Start;
    appt.End = obj.End;


    appt.ReminderMinutesBeforeStart = obj.ReminderMinutesBeforeStart;

    appt.Display();
    return null;
    }
    </script>






  7. Go to the <td> tag of your newly created column (search for Reserved By, it will be a couple of lines beneath it). Add a button which will execute previously created code snippet:
    <input type="button" value="Outlook" 
    onclick="javascript:createOutlookAppointment('{@Title}','{@Resource}',
    '{@RERStartDate}','{@REREndDate}');return true;"/>










As a result the users will have next to each reservation a button.




Clicking on the button will create a Microsoft Outlook appointment with the data previously entered upon creation of the reservation in Microsoft SharePoint.



You can extend the Reservations list, by adding additional columns, whose data could be added upon creation of the Microsoft Outlook appointment.


Continue reading......

by Patrik Luca 33 comments

08 March 2008

40 application templates: where are the site content types?

Upon using one of the 40 application templates provided by Microsoft, you may be wondering where the site content types are, with which these templates are build. The site content types belong to the site content type group _Hidden: hence they are not visible on the site content types page.

This can be annoying in following scenarios:

  • If you want to create a new site content type which has as parent content type one of those hidden site content types, you can't.

  • If you want to limit the data displayed in a Content Query Web Part on a certain page in your sites, you cannot filter on the Content Type for those hidden site content types.

To move the site content types included in the 40 application templates out of the _Hidden site content type group, follow these steps:
  1. Go to the directory %Program Files%\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\TSATypes

  2. Open the CTypes.xml file with an editor.

  3. Search for the Site Content Type that you would like to make visible in the GUI. I'll give the example with the Service Request Site Content Type of the Helpdesk Application Template.

  4. In the Content Type tag, replace the value for the site content type group (which is set to _Hidden) with the value $Resources:core,List_Content_Types;

  5. Execute following script (it deactivates and reactivates the tsatypes feature and executes an iisreset:
    echo off
    @set PATH=C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN;%PATH%
    @if "%1"=="" (goto invalidParameters)
    stsadm -o deactivatefeature -filename "tsatypes\feature.xml" -url %1
    stsadm -o activatefeature -filename "tsatypes\feature.xml" -url %1
    iisreset
    @goto endOfBatch
    :invalidParameters
    @echo Please call with the correct parameters.
    @echo The correct syntax of this command is:
    @echo tsatypes [siteurl]
    :endOfBatch



Go to Site Actions -> Site Settings -> Site content types: the Service Request Site Content Type is visible on the page in the group List Content Types. Hence it can be used as parent content type for new site content types.

In the Content Query Web Part, the Service Request Site Content Type can be chosen to filter on: choose List Content Types in the dropdown box Show items of this content type group and choose the Service Request Site Content Type in the dropdown box Show items of this content type.


Continue reading......

by Patrik Luca 3 comments

Patrik Luca, Ieper, BELGIUM
Feel free to use or spread all of the content on my blog. In return, linking back to my blog would be greatly appreciated. All my posts and articles are provided "AS IS" with no warranties.

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Most Read Entries

Categories

Recommended Books


Subscribe feeds rss Recent Comments

This Blog is part of the U Comment I Follow movement in blogosphere. Means the comment field of this blog is made DOFOLLOW. Spam wont be tolerated.

Live Traffic Feed

Recent Visitors

Blog Archive

My Blog List

Followers

Guest Links