11
How to get the Formatted Data from SharePoint which belong to the regional settings Phong Le Technical Manager Bamboo Solutions

2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?

Embed Size (px)

DESCRIPTION

2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?from Phong Le

Citation preview

Page 1: 2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?

How to get the Formatted Data from SharePoint which belong to the

regional settings

Phong LeTechnical ManagerBamboo Solutions

Page 2: 2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?

Agenda

1. SharePoint Regional Settings• Site Regional Settings.• User Regional Settings.

2. SharePoint Format Value• Format value by Site settings.• Format value by user settings.

3. Demo

4. Q&A

Page 3: 2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?

SharePoint Regional Settings

1. Site Regional Settings• These settings affect the current site or

site collection.• Step by step.

Page 4: 2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?

SharePoint Regional Settings (Cont.)

2. User Regional Settings• These settings only affect your own

account.• users can either use the default

regional settings that are set on a specific site or set their own regional settings.

• Step by step.

Page 5: 2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?

Get Format Value From Regional Settings

1. Use Function of Object SPField• Use GetFieldValueAsHtml(value) of

object SPField.• Format of this function depend on Site

Setting.• But It is independent on User Setting.

Page 6: 2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?

Get Format Value From Regional Settings

2. Use Function of Object SPListItem• GetFormattedValue(InternalName).• Format of this function depend on Site

Setting.• But It is independent on User Setting.

Page 7: 2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?

Get Format Value From Regional Settings

3. Use Functions of static SPField• SPFieldNumber.GetFieldValueAsHtml(val

ueNumber, new CultureInfo(lcid), spFieldNumber.ShowAsPercentage, spFieldNumber.DisplayFormat);

• SPFieldDateTime.GetFieldValueAsHtml(valueTime, SPContext.Current.Web, SPDateFormat);

Page 8: 2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?

Get Format Value From Regional Settings

3. Use Functions of static SPField (cont)

• Get format value with user settings.• SPContext.Current.Web.• int lcid =

(int)SPContext.Current.RegionalSettings.LocaleId.

Page 9: 2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?

Demo

Page 10: 2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?

Q&A

Page 11: 2nd SPS Vietnam - How to get formatted data from SharePoint which belong to the regional settings?

THANK YOU