Friday, March 25, 2011

Have search results display the filename of a word doc, instead of the Title Metadata in SharePoint 2010 !

Below are the steps for customizing search result:
Step#1: Site Action --> Edit Page

Step#2: Find Search Core Results Webpart --> Edit Web Part.

Step#3: Go to Display Properties --> Fetched Properties Text box --> <Column Name="Title"/> replace with <Column Name="FileName"/>

Step#4: Click on XSL Editor... Button -->
follow below steps:
1)


<xsl:value-of select="@title"/>
replace with below code


<xsl:value-of select="@filename"/>
2)
<a href="{$url}" id="{concat('CSR_',$id)}" title="{title}">
replace with below code


<a href="{$url}" id="{concat('CSR_',$id)}" title="{filename}">

3)
<xsl:value-of select="title"/>
replace with below code
<xsl:value-of select="filename"/>
4)


<xsl:value-of disable-output-escaping="yes" select="srwrt:HtmlAttributeEncode(title)" />
replace with below code

<xsl:value-of disable-output-escaping="yes" select="srwrt:HtmlAttributeEncode(filename)" />

5)

<xsl:value-of select="srwrt:HtmlEncode(title)"/>
replace with below code


<xsl:value-of select="srwrt:HtmlEncode(filename)"/>




6)

<xsl:attribute name="title">
replace with below code

<xsl:attribute name="filename">

7)
<xsl:value-of select="title"/>
replace with below code
<xsl:value-of select="filename"/>

8)

<xsl:value-of select="title"/>
replace with below code

<xsl:value-of select="filename"/>


Saturday, March 12, 2011

Column Validation in SharePoint 2010 And Formulas !!!

The ability to easily validate the column values entered into list items is a welcome addition to SharePoint 2010. I'd like to walk thru 2 simple example s of how to use column validation, at the column level, then at the list level. I'll then point out some specific notes about this feature.

Introduction to data calculations



You can use formulas and functions in lists or libraries to calculate data in a variety of ways. By adding a calculated column to a list or library, you can create a formula that includes data from other columns and performs functions to calculate dates and times, to perform mathematical equations, or to manipulate text. For example, on a tasks list, you can use a column to calculate the number of days it takes to complete each task, based on the Start Date and Date Completed columns.



Note This article describes the basic concepts related to using formulas and functions. For specific information about a particular function, see the article about that function.





--------------------------------------------------------------------------------



•Formulas overview

•Functions overview

•Using column references in a formula

•Using constants in a formula

•Using calculation operators in a formula



--------------------------------------------------------------------------------

Formulas overview

Formulas are equations that perform calculations on values in a list or library. A formula starts with an equal sign (=). For example, the following formula multiplies 2 by 3 and then adds 5 to the result.



=5+2*3



You can use a formula in a calculated column and to calculate default values for a column. A formula can contain functions (function: A prewritten formula that takes a value or values, performs an operation, and returns a value or values. Use functions to simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex calculations.), column references, operators (operator: A sign or symbol that specifies the type of calculation to perform within an expression. There are mathematical, comparison, logical, and reference operators.), and constants (constant: A value that is not calculated and, therefore, does not change. For example, the number 210, and the text "Quarterly Earnings" are constants. An expression, or a value resulting from an expression, is not a constant.), as in the following example.



=PI()*[Result]^2



Element Description

Function The PI() function returns the value of pi: 3.141592654.

Reference (or column name) [Result] represents the value in the Result column for the current row.

Constant Numbers or text values entered directly into a formula, such as 2.

Operator The * (asterisk) operator multiplies, and the ^ (caret) operator raises a number to a power.



A formula might use one or more of the elements from the previous table. Here are some examples of formulas (in order of complexity).



Simple formulas (such as =128+345)

The following formulas contain constants and operators.



Example Description

=128+345 Adds 128 and 345

=5^2 Squares 5



Formulas that contain column references (such as =[Revenue] >[Cost])

The following formulas refer to other columns in the same list or library.



Example Description

=[Revenue] Uses the value in the Revenue column.

=[Revenue]*10/100 10% of the value in the Revenue column.

=[Revenue] > [Cost] Returns Yes if the value in the Revenue column is greater than the value in the Cost column.



Formulas that call functions (such as =AVERAGE(1, 2, 3, 4, 5))

The following formulas call built-in functions.



Example Description

=AVERAGE(1, 2, 3, 4, 5) Returns the average of a set of values.

=MAX([Q1], [Q2], [Q3], [Q4]) Returns the largest value in a set of values.

=IF([Cost]>[Revenue], "Not OK", "OK") Returns Not OK if cost is greater than revenue. Else, returns OK.

=DAY("15-Apr-2008") Returns the day part of a date. This formula returns the number 15.



Formulas with nested functions (such as =SUM(IF([A]>[B], [A]-[B], 10), [C]))

The following formulas specify one or more functions as function arguments.



Example Description

=SUM(IF([A]>[B], [A]-[B], 10), [C]) The IF function returns the difference between the values in columns A and B, or 10.



The SUM function adds the return value of the IF function and the value in column C.



=DEGREES(PI()) The PI function returns the number 3.141592654.



The DEGREES function converts a value specified in radians to degrees. This formula returns the value 180.



=ISNUMBER(FIND("BD",[Column1])) The FIND function searches for the string BD in Column1 and returns the starting position of the string. It returns an error value if the string is not found.



The ISNUMBER function returns Yes if the FIND function returned a numeric value. Else, it returns No.





Top of Page



Functions overview

Functions are predefined formulas that perform calculations by using specific values, called arguments, in a particular order, or structure. Functions can be used to perform simple or complex calculations. For example, the following instance of the ROUND function rounds off a number in the Cost column to two decimal places.



=ROUND([Cost], 2)



The following vocabulary is helpful when you are learning functions and formulas:



Structure The structure of a function begins with an equal sign (=), followed by the function name, an opening parenthesis, the arguments for the function separated by commas, and a closing parenthesis.



Function name This is the name of a function that is supported by lists or libraries. Each function takes a specific number of arguments, processes them, and returns a value.



Arguments Arguments can be numbers, text, logical values such as True or False, or column references. The argument that you designate must produce a valid value for that argument. Arguments can also be constants, formulas, or other functions.



In certain cases, you may need to use a function as one of the arguments of another function. For example, the following formula uses a nested AVERAGE function and compares the result with the sum of two column values.



=AVERAGE([Cost1], SUM([Cost2]+[Discount]))



Valid returns When a function is used as an argument, it must return the same type of value that the argument uses. For example, if the argument uses Yes or No, then the nested function must return Yes or No. If it doesn't, the list or library displays a #VALUE! error value.



Nesting level limits A formula can contain up to eight levels of nested functions. When Function B is used as an argument in Function A, Function B is a second-level function. In the example above for instance, the SUM function is a second-level function because it is an argument of the AVERAGE function. A function nested within the SUM function would be a third-level function, and so on.



Notes



•Lists and libraries do not support the RAND and NOW functions.

•The TODAY and ME functions are not supported in calculated columns but are supported in the default value setting of a column.

Top of Page



Using column references in a formula

A reference identifies a cell in the current row and indicates to a list or library where to search for the values or data that you want to use in a formula. For example, [Cost] references the value in the Cost column in the current row. If the Cost column has the value of 100 for the current row, then =[Cost]*3 returns 300.



With references, you can use the data that is contained in different columns of a list or library in one or more formulas. Columns of the following data types can be referenced in a formula: single line of text, number, currency, date and time, choice, yes/no, and calculated.



You use the display name of the column to reference it in a formula. If the name includes a space or a special character, you must enclose the name in square brackets ([ ]). References are not case-sensitive. For example, you can reference the Unit Price column in a formula as [Unit Price] or [unit price].



Notes



•You cannot reference a value in a row other than the current row.

•You cannot reference a value in another list or library.

•You cannot reference the ID of a row for a newly inserted row. The ID does not yet exist when the calculation is performed.

•You cannot reference another column in a formula that creates a default value for a column.

Top of Page



Using constants in a formula

A constant is a value that is not calculated. For example, the date 10/9/2008, the number 210, and the text "Quarterly Earnings" are all constants. Constants can be of the following data types:



•String (Example: =[Last Name] = "Smith")

String constants are enclosed in quotation marks and can include up to 255 characters.



•Number (Example: =[Cost] >= 29.99)

Numeric constants can include decimal places and can be positive or negative.



•Date (Example: =[Date] > DATE(2007,7,1))

Date constants require the use of the DATE(year,month,day) function.



•Boolean (Example: =IF([Cost]>[Revenue], "Loss", "No Loss")

Yes and No are Boolean constants. You can use them in conditional expressions. In the above example, if Cost is greater than Revenue, the IF function returns Yes, and the formula returns the string "Loss". If Cost is equal to or less than Revenue, the function returns No, and the formula returns the string "No Loss".



Top of Page



Using calculation operators in a formula

Operators specify the type of calculation that you want to perform on the elements of a formula. Lists and libraries support three different types of calculation operators: arithmetic, comparison, and text.



Arithmetic operators

Use the following arithmetic operators to perform basic mathematical operations such as addition, subtraction, or multiplication; to combine numbers; or to produce numeric results.



Arithmetic operator Meaning (example)

+ (plus sign) Addition (3+3)

– (minus sign) Subtraction (3–1)

Negation (–1)

* (asterisk) Multiplication (3*3)

/ (forward slash) Division (3/3)

% (percent sign) Percent (20%)

^ (caret) Exponentiation (3^2)



Comparison operators

You can compare two values with the following operators. When two values are compared by using these operators, the result is a logical value of Yes or No.



Comparison operator Meaning (example)

= (equal sign) Equal to (A=B)

> (greater than sign) Greater than (A>B)

< (less than sign) Less than (A

>= (greater than or equal to sign) Greater than or equal to (A>=B)

<= (less than or equal to sign) Less than or equal to (A<=B)

<> (not equal to sign) Not equal to (A<>B)



Text operator

Use the ampersand (&) to join, or concatenate, one or more text strings to produce a single piece of text.



Text operator Meaning (example)

& (ampersand) Connects, or concatenates, two values to produce one continuous text value ("North"&"wind")



Order in which a list or library performs operations in a formula

Formulas calculate values in a specific order. A formula might begin with an equal sign (=). Following the equal sign are the elements to be calculated (the operands), which are separated by calculation operators. Lists and libraries calculate the formula from left to right, according to a specific order for each operator in the formula.



Operator precedence

If you combine several operators in a single formula, lists and libraries perform the operations in the order shown in the following table. If a formula contains operators with the same precedence — for example, if a formula contains both a multiplication operator and a division operator — lists and libraries evaluate the operators from left to right.



Operator Description

– Negation (as in –1)

% Percent

^ Exponentiation

* and / Multiplication and division

+ and – Addition and subtraction

& Concatenation (connects two strings of text)

= < > <= >= <> Comparison



Use of parentheses

To change the order of evaluation, enclose in parentheses the part of the formula that is to be calculated first. For example, the following formula produces 11 because a list or library calculates multiplication before addition. The formula multiplies 2 by 3 and then adds 5 to the result.



=5+2*3



In contrast, if you use parentheses to change the syntax, the list or library adds 5 and 2 together and then multiplies the result by 3 to produce 21.



=(5+2)*3



In the example below, the parentheses around the first part of the formula force the list or library to calculate [Cost]+25 first and then divide the result by the sum of the values in columns EC1 and EC2.



=([Cost]+25)/SUM([EC1]+[EC2])



These entries are from SP help...

http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/d72e751b-d3f6-4e81-9a4e-542077d05287

http://blogs.pointbridge.com/Blogs/2010wave/Pages/Post.aspx?_ID=5

Examples of common formulas

http://office.microsoft.com/en-us/sharepoint-foundation-help/examples-of-common-formulas-HA010379915.aspx#BM4


Good luck,

Srikanth Reddy




Friday, March 11, 2011

Configuring Enterprise Search in SharePoint 2010

We all have to agree that search plays an integral part of any successful SharePoint deployment and is an area that Microsoft continues to invest in with each new release of SharePoint. Microsoft went as far as acquiring FAST 2 years ago which it now offers as a separate add-on to SharePoint for those willing to invest in high end enterprise search. In addition to FAST, SharePoint 2010 search comes in a number of flavors each offering their own feature set and capabilities which I have duplicated at the end of this article as an Appendix for convenience.




Today we will introduce SharePoint Server 2010 Search and eventually work our way up to Microsoft’s latest and greatest FAST Search Server in a near future article. Before we deep dive into the step by step guide I will begin by listing some of the new features that you will come to expect from SharePoint Server 2010 Search. These are as follows;



Boolean query syntax has finally been introduced. These include AND, OR and NOT operators in your search queries.

Suggestions whilst typing and after running search queries, a feature that we have come to love with major search engines such as Google and Bing.

Integrating SharePoint enterprise search with Windows 7, allowing end users to utilise the Windows 7 search box to locate SharePoint 2010 content.

Results display has been refined to provide filters for search results such as document type, categories and managed properties.

View in Browser capabilities, allows end users to view documents within their own browser utilising Office Web Apps and not having to rely on launching the necessary Microsoft Office Application, or even the need of having it installed on their local machine. This is handy when browsing your SharePoint site via Kiosks and Internet Cafes that may not be running the Microsoft Office Suite.

Last but not least, there have been a number of improvements to People Search, including phonetic name and nickname matching, and improved relevance and self search.

Now that we have a taste for what’s to come, let’s begin our configuration.



SharePoint Server Search is a service application which we have come to learn about over the past few articles that it is independent of other services and is no longer tied to the Shared Services Provider (SSP) that was introduced in SharePoint 2007.



SharePoint 2010 search architecture is made up of the Crawler, Indexing Engine, Query Engine and the User Interface and Query Object Model. We now have greater flexibility and expandability with our search design in 2010 and can setup not only multiple Query Servers but can now scale out our Index server and add multiple instances.



Below is a link overview of the components that will make up our SharePoint 2010 search configuration.

http://sharepointgeorge.com/2010/configuring-enterprise-search-sharepoint-2010/

http://www.virtualsecrets.com/misc_imgs/sharepoint-2010/search-service-config.html 



Sharepoint 2010 Rich Look Up Control !!!

Overview

 
AnjLab Sharepoint RichControls is a library that provides enhanced lookup control for Sharepoint 2010 lookup fields. This is open beta release. The software is provided "as is", without warranty of any kind.

 
Features
  1. No Sharepoint dropdowns and preloaded data
  2. Quick data finding and selecting using autocomplete
  3. Select fields you would like to see in autocomplete box
  4. Supports single-selection and multi-selection modes
  5. Customizable title, description fields, look and behavior
  6. Filter lookup data using CAML queries at server side!
  7. Adds button to create new item in lookup list
  8. Use RichControl with Sharepoint 2010 lookup fields
  9. Supports languages (English and Russian included)
  10. Uses JQuery library
  11. Delivered as Sharepoint Solution Package (WSP)
SharePoint Rich LookUp Control