Thursday, 5 August 2010

SharePoint 2010 Multilingual Interface (Hindi)

Thought of updating you on my findings in SharePoint 2010 – this might be useful pointers for you; a little spanner in your works. I was testing the Multilingual Interface of SharePoint 2010; Seems SharePoint 2010 is improved and extended its capabilities on the good old MOSS 2007.
Both SharePoint foundation 2010 and SharePoint Server 2010 have language packs are avaialble to install, but if you are using licenced version of SharePoint Server 2010 you need to install both the SharePoint Foundation and the SharePoint Server langauage packs.
I downloded the Hindi Language pack and installed - http://www.microsoft.com/downloads/details.aspx?FamilyID=046f16a9-4bce-4149-8679-223755560d54&displaylang=en
Once you install the language packs you can take advantage of Multilingual User Interface (MUI). The lanaguage is enabled on per-site basis Administration > Language settings will list out all the languages you installed.












Once after you turn on alternate language, you can change the language of SharePoint interface. Click you name on the upper right corner, hover over Display language and choose which language you’d like the site translated into.



The Ribbon, Site Actions Menu, Site Settings Menu and other SharePoint components will be translated to the selected language.
SharePoint 2010 has done a pretty descent job in multi language implementation – List/ Document libraries column title that are pre-built into a list are automatically translated, however you can translate custom coloumns and engage metadata service application for further translation.






The Out of the Box Menus and predefined labels are changed to the selected language.




However when i did the searching there were many glitches - i could still see “English” popping up – seems this should be fixed by more mapping of the metadata.




Sunday, 18 April 2010

How to Use CAML Query to get Data from SharePoint 2007 List


I was enjoying my summer with some CAML queries – All I wanted was to get some data from a simple Products List in SharePoint 2007. The list was pretty simple with 2 colomns "Product" and "Cost". I used U2U to create a pretty descent CAML query. I created a simple website in VS2008 to test it !!! It all worked fantastically!!!
Here is my Quick Dirty code –
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.SharePoint;

namespace WebApplication1
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SPList mylist=new SPSite ("http://sharepointlogics").OpenWeb ().Lists ["Products"];
SPQuery query=new SPQuery ();
query.Query = "";
SPListItemCollection items=mylist.GetItems (query);

foreach (SPListItem proditem in items )
{
Response.Write(proditem["Title"].ToString ());
Response.Write(proditem["Cost"]);

}


}
}
}

So what it does is, it opens a site called sharepointlogics and then it finds a list called "Products"from the list and then get the item names and Cost out of the list and using a simple Response.Write writes it to a page.

So all you need to do is fire up your Visual Studio, create a simple SharePoint site and a list in the site called "Products" and then copy paste the code on a C# project and run it.

Thats all!!!! it will start fetching values from your sharepoint site and will display you.....
Just a simple starter..........

Hope you would enjoy it !!!!

Friday, 26 March 2010

Total Count of Items in a List in Sharepoint


I had a recent assignment to test the performance of a List. The list was behaving really slow and I need to determine the total number of items in the list.
Aaaah ………… there starts the problem. I wanted the total number of items in the list and I could only do that by navigating through the List Item pages which was around 20,000 + Items, So need to click through every single pages and it would take couple of months to figure out the exact numbers. Then I thought about the "Calculated Columns" in Sharepoint.
Finally I figured out to get the total count of the Items in a Sharepoint List. Here are the steps -



Step 1.Create a "Calculated (calculation based on other columns) " column in the List
Step 2.Column Name - "Total"
The Type of Information in this column - "Calculated"
In the Formula Column put - "=SUM(ID)" (without apostrophise)
Select "The data type returned from this formula is: " as Number
Step 3.Select "OK" - a new column will be added to the List and then you could see the Column "Total" which would display values from 1 to End number in ascending order. If you click the header "Total" the list would be displayed in descending order displaying the Total number of the Items in the list.

Now.... however this is not an optimal solution considering that if you delete an item sharepoint still retains the ID and hence it still shows the total count (including the deleted item). So you can use this solution with a variation and use it appropriately.

To fix the total count issue,  there is another solution; You can follow the below steps:

Step 1.
Go to the list, click on the list tab, Click on "Modify View"

Step 2.
Scroll to the bottom of the page, there will be an option called "Totals"
Step 3.
Click on the column which you want to show the count, select count option here it is the "Name column"
Step 4.
Now if you go back to the list, you can see a new column "Count" with the total count of items on it.

Hope this  helps....... Do let me know your feedback .

Also If you are looking to filter a list based on user/Group permission, this post says it http://sharepointlogics.com/2014/02/how-to-filter-sharepoint-list-based-on.html

Tuesday, 9 March 2010

Sharepoint Service Pack 2 Release

Sharepoint 2007 Service Pack 2 Release(MOSS SP2)

I got a new task assigned to upgrade my MOSS Farm from SP1 to SP2.
Here are the steps which I done
Step 1
Installed Service Pack 2 for Windows SharePoint Services 3.0, x86 & x64
http://www.microsoft.com/downloads/details.aspx?FamilyId=79BADA82-C13F-44C1-BDC1-D0447337051B&displaylang=en

Step 2
Installed Service Pack 2 for Office SharePoint Server 2007, x86 & x64
http://www.microsoft.com/downloads/details.aspx?FamilyId=B7816D90
Once after the upgrade checkpoints -

Check 1
Go to the Control Panel>Add remove programs > Select "Microsoft Office Sharepoint Server 2007" > Click here for Support Information. This would be updated to 12.0.6425.1000












    Check 2
    Go to Central Admin > Operations > Servers In Farm > The Version would be upgrade to 12.0.0.6421 from 12.0.0.6219








    Possible Errors
    Strangely I was getting the below error while installing "Service Pack 2 for Office SharePoint Server 2007" Installer -










    The error was saying something pertaining to Registry and Microsoft Search Front End which was a bit confusing, but later I found this was happening because of Disk Space on my C Drive.

    Event Type: Error
    Event Source: MsiInstaller
    Event Category: None
    Event ID: 1023
    Date: 08/03/2010
    Time: 18:27:26
    User: *****\Administrator
    Computer: ******
    Description:
    The description for Event ID ( 1023 ) in Source ( MsiInstaller ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Microsoft Search Front End, 2007 Microsoft Office System Servers Service Pack 2 (SP2), 1603, C:\DOCUME~1\ADMINI~1.APP\LOCALS~1\Temp\coreserverwwsp2_MSPLOG.LOG, (NULL), , .

    Creating a bit more space (1 GB) and rerunning the Installer fixed the issue, So a quick check would be on your C: drive space before you install the Service packs.


    Known Error Lists Once after SP2 Release
    http://www.wictorwilen.se/Post/SharePoint-Service-Pack-2-known-found-and-experienced-problems.aspx

    Tuesday, 2 March 2010

    Creating SharePoint 2007 Timer Jobs

    I was searching for some articles on how to Create Sharepoint 2007 Timer Jobs - and i found some nice ones, Andrew is describing it very well on his articles - Check out.
    http://www.andrewconnell.com/blog/archive/2007/01/10/5704.aspx
    http://www.andrewconnell.com/blog/archive/2008/04/15/More-help-on-creating-custom-timer-jobs-and-a-useful.aspx

    Tuesday, 23 February 2010

    How to check Sharepoint 2007 Versions

    How to check Sharepoint 2007 Versions

    Recently I was trying to figure out the Version of Sharepoint and yes it's not pretty straight forward you might need to do several tricks to determine it.

    Here are some pointers –

    1. Navigate to the \12\bin\ folder and check file versions (For more information on the first technique read this TechNet article)
    2. Use IIS Manager and look at the web site properties

    Second approach - because it takes some of the guesswork out of the process.  The basic steps for using IIS Manager to determine the SharePoint version are:

    1. Sign in one of your SharePoint front end web servers
    2. Open IIS Manager (can be found by navigating to Start, Administrative Tools, Internet Information Server (IIS) Manager)
    3. Expend the folder labeled "Web Sites"
    4. Right-click on the web site named "SharePoint Central Administration" and select "Properties"
    5. Click on the tab named "HTTP Headers"
    6. Look at the field named "Customer HTTP Headers"
    7. Compare the value displayed for "MicrosoftSharePointTeamServices" to the following list.

    http://www.mindsharpblogs.com/penny/articles/481.aspx

    http://www.sharepointdesignerstepbystep.com/Blog/Articles/How%20To%20find%20the%20SharePoint%20version.aspx

    http://support.microsoft.com/kb/936988

    Friday, 29 January 2010

    Create a webpage with Div tags and no tables

    I was searching to figure out how to create a page layout with no tables for one of my SharePoint projects. I designed one with the basic <div> tag and css and no <tables>, I used inline CSS script for this.


    The code I used is as below

    <!--

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    <!-- <link rel="stylesheet" href="" type="text/css"> -->

    <html>

    <head>

    <style type="text/css">

    #wrapper{

    width:1000px;

    margin:0px auto;

    border:1px solid #acb;

    padding:10px;

    }

    #header {

    border:1px solid #bbb;

    height:100px;

    padding:10px;

    }

    #content {

    margin-top:10px;

    padding-bottom:10px;


    }


    #content div {

    padding:10px;

    border:1px solid #bbb;

    float:left;

    }

    #content-left {

    width:180px;

    height:500px;

    }


    #content-main {

    width:585px;

    height:500px;

    margin-left:10px;

    }


    #content-right {

    width:150px;

    height:500px;

    margin-left:10px;

    }

    #footer {

    float:left;

    margin-top:10px;

    margin-bottom:10px;

    border:1px solid #abc;

    height:80px;

    padding:10px;

    height:80px;

    width:980px;

    }

    #bottom {

    clear:both;

    text-align:right;

    }

    </style>

    </head>

    <body>

    <div id="wrapper">

    <div id="header"><center>Header</center></div>

    <div id="content">

    <div id="content-left">Left Content</div>

    <div id="content-main"><center>Main Content</center></div>

    <div id="content-right"><center>Right Content</center></div>

    </div>

    <div id="footer"><center>Footer</center></div>

    <div id="bottom"></div>

    </body>

    </html>

    -->

    Thursday, 28 January 2010

    How to create files of any size

    How to create files of any size

    fsutil file createnew C:\Brij\One_MB_File.doc 1024000

    Above command will create 1 MB file called "One_MB_File.doc" at C:\Brij location.

    You can provide any file extension - e.g. .txt, .xls, .ppt, .pdf etc.

    This command may help in creating files for upload/download test in SharePoint or any other application.

    Thursday, 21 January 2010

    Sharepoint Maintenance Page

    Recently I got a requirement asking me to create a "Maintenance Page" in my Sharepoint Farm for a new Release.
    I was trying to set a simple "Offline.htm" page in IIS and setting it as the default page in the Documents, but unfortunately this would never work as in a regular .Net application. Done a bit research and found a good article of Scott Guthrie. I would walk through the steps to get this done -
    Step 1.Create a page "App_Offline.htm" in the Root Site - When Asp.net see this page it would unload the AppDomain for the application and would render this page.
    However, there is a catch, I was trying to do this the application was down but the page was not rendered instead I was getting a 404, found out this was because if the content in the ".htm" page is less than 512 bytes IE would only render the custom error page.

    Step 2.
    Make the Page size greater than the limit, something similar to this- Bingo !!! and it should work .