protected void btnExportExcel_Click(object sender, EventArgs e)
{
DataSet ds = CurrentApproverService.GetReportData(depID, UserID);
DataGrid dg = new DataGrid();
dg.DataSource = ds;
dg.DataBind();
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=" + "ReportData.xls");
Response.ContentType = "application/excel";
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
dg.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
dg = null;
dg.Dispose();
}
Wednesday, August 17, 2011
Monday, August 8, 2011
How SharePoint 2010 Installation creates SQL Sever DataBases
I was able to get step by step screen shots of,
SharePoint 2010 installation Vs. SQL Server DB creation
(1) Initial DB structure
SharePoint 2010 installation Vs. SQL Server DB creation
(1) Initial DB structure
(2) While SharePoint 2010 Installing
(3) Step 3 of "SharePoint 2010 product configuration" is the main step that creates "Config" database
(4) When "Configure SharePoint Farm" using Central Administration
(5) SQL DB structure while running wizard
(6) After Configured All Services in "SharePoint 2010"
It is Easy And Structured :)
Localization in SharePoint
It was a horrible week for me, because of a too critical task, i.e.LOCALIZATION
Finally i was able to do it :) :) :)
*** Added "ChanaApp.resx" to App_GlobalResources folder in [Port] folder
*** Added "ChanaApp.nl.resx" to same folder
*** Added a label to .ASPX page
*** Set the Expression of the label, set the TEXT property using "Resources"
*** If only one page we can use
protected override void InitializeCulture()
{
string[] languages = HttpContext.Current.Request.UserLanguages;
string language = languages[0].ToLowerInvariant().Trim();
string selectedLanguage = language;
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(selectedLanguage);
Thread.CurrentThread.CurrentUICulture = new
CultureInfo(selectedLanguage);
base.InitializeCulture();
}
*** If for total web application then we have to use
protected void Application_BeginRequest(object sender, EventArgs e)
{
string[] languages = HttpContext.Current.Request.UserLanguages;
string language = languages[0].ToLowerInvariant().Trim();
string selectedLanguage = language;
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(selectedLanguage);
Thread.CurrentThread.CurrentUICulture = new
CultureInfo(selectedLanguage);
}
in GLOBAL.ASAX file.
*** Change the Culture of browser will change the TEXT in the label
Finally i was able to do it :) :) :)
*** Added "ChanaApp.resx" to App_GlobalResources folder in [Port] folder
*** Added "ChanaApp.nl.resx" to same folder
*** Added a label to .ASPX page
*** Set the Expression of the label, set the TEXT property using "Resources"
*** If only one page we can use
protected override void InitializeCulture()
{
string[] languages = HttpContext.Current.Request.UserLanguages;
string language = languages[0].ToLowerInvariant().Trim();
string selectedLanguage = language;
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(selectedLanguage);
Thread.CurrentThread.CurrentUICulture = new
CultureInfo(selectedLanguage);
base.InitializeCulture();
}
*** If for total web application then we have to use
protected void Application_BeginRequest(object sender, EventArgs e)
{
string[] languages = HttpContext.Current.Request.UserLanguages;
string language = languages[0].ToLowerInvariant().Trim();
string selectedLanguage = language;
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(selectedLanguage);
Thread.CurrentThread.CurrentUICulture = new
CultureInfo(selectedLanguage);
}
in GLOBAL.ASAX file.
*** Change the Culture of browser will change the TEXT in the label
Saturday, July 9, 2011
Enable "Master Page" in a team site
We cant see "Master Page" in Look and Feel section
Enable "Site Collection" feature
Enable "Site" feature
Now we can see "Master Page" under "Look and Feel" section
Monday, June 27, 2011
Download SharePoint 2010 Pre-Requisites
| Microsoft SQL Server 2008 Native Client | Download Here |
| Hotfix for Microsoft Windows (KB976462) | Download Here |
| Windows Identity Foundation (KB974405) | Download Here |
| Microsoft Sync Framework Runtime v1.0 (x64) | Download Here |
| Microsoft Chart Controls for Microsoft .NET Framework 3.5 | Download Here |
| Microsoft Filter Pack 2.0 | Download Here |
| Microsoft SQL Server 2008 Analysis Services ADOMD.NET | Download Here |
| Microsoft Server Speech Platform Runtime (x64) | Download Here |
| Microsoft Server Speech Recognition Language – TELE(en-US) | Download Here |
| SQL 2008 R2 Reporting Services SharePoint 2010 Add-in | Download Here |
Microsoft Office 2010 Filter Packs for SharePoint
The Microsoft Filter Pack is a single point-of-distribution for Office IFilters. IFilters are components that allow search services to index content of specific file types, letting you search for content in those files. They are intended for use with Microsoft Search Services (Sharepoint, SQL, Exchange, Windows Search).
* Legacy Office Filter (97-2003; .doc, .ppt, .xls)
* Metro Office Filter (2007; .docx, .pptx, .xlsx)
* Zip Filter
* OneNote filter
* Visio Filter
* Publisher Filter
* Open Document Format Filter
Thursday, June 23, 2011
SharePoint 2010 People Picker Programatically
PeopleEditor peoplePick = new PeopleEditor();
protected override void CreateChildControls()
{
peoplePick.AllowEmpty = false;
peoplePick.AllowTypeIn = true;
peoplePick.BrowseButtonImageName = "Search";
peoplePick.CheckButtonImageName = "Validate User";
peoplePick.ErrorMessage = "No Names Found";
tdPeoplePicker.Controls.Add(peoplePick);
//this.Controls.Add(peoplePick);
base.CreateChildControls();
}
protected void btnSave_Click(object sender, EventArgs e)
{
foreach (string ent in peoplePick.CommaSeparatedAccounts.Split(','))
{
if (ent.Length > 0)
{
PeerReviewGroup_Employee objPeerEmp = new PeerReviewGroup_Employee();
objPeerEmp.EmpID = Utility.GetNullableInt(GetSelectedUserIDsByName(ent));
objPeerEmp.GroupID = int.Parse(ddlPeerGroup.SelectedValue);
PeerReviewGroup_EmployeeService.Save(objPeerEmp);
}
}
}
protected override void CreateChildControls()
{
peoplePick.AllowEmpty = false;
peoplePick.AllowTypeIn = true;
peoplePick.BrowseButtonImageName = "Search";
peoplePick.CheckButtonImageName = "Validate User";
peoplePick.ErrorMessage = "No Names Found";
tdPeoplePicker.Controls.Add(peoplePick);
//this.Controls.Add(peoplePick);
base.CreateChildControls();
}
protected void btnSave_Click(object sender, EventArgs e)
{
foreach (string ent in peoplePick.CommaSeparatedAccounts.Split(','))
{
if (ent.Length > 0)
{
PeerReviewGroup_Employee objPeerEmp = new PeerReviewGroup_Employee();
objPeerEmp.EmpID = Utility.GetNullableInt(GetSelectedUserIDsByName(ent));
objPeerEmp.GroupID = int.Parse(ddlPeerGroup.SelectedValue);
PeerReviewGroup_EmployeeService.Save(objPeerEmp);
}
}
}
Monday, April 25, 2011
How to kill a remote session using command
Step 1. Gain enough privilege to kill RDP connection on the server.
net use \\servername_or_IP /USER:username “password“
Step 2. List the connection to a particular server and get session ID.
query session /server: servername_or_IP
Step 3. Reset the session which you don’t need using ID of the session got from previous step
net use \\servername_or_IP /USER:username “password“
Step 2. List the connection to a particular server and get session ID.
query session /server: servername_or_IP
Step 3. Reset the session which you don’t need using ID of the session got from previous step
reset session [sessionID] /server:servername_or_IP
Monday, April 11, 2011
Configure Drop-off Library in SharePoint 2010
Sometimes we need to have a common place to upload documents by a clerk & store data in correct data repository without his/her intervention. we can have a "Drop Off Library" and created "Rule", then documents will be stored relevant document library. we don't have to give permission for different users to upload documents to different libraries. It is with SharePoint 2010 :)

Finally we can see, the uploaded document is stored in "SDB Quotations" library. No copy is maintained in "Drop Off Library" . It is simple :)
Wednesday, April 6, 2011
SharePoint 2010 Recycle bin settings
There are 2 types of recycle bin in SharePoint. Even user deletes an item it will be stored in "Recycle Bin" of admin's. We can set a time period to keep those files in Admin's recycle bin. We can give a quota to recycle bin of normal users as well as admins.
It is also possible to set maximum file size that can be stored in SharePoint. Since all data stored in DB, it is recommended to store medium size files in SharePoint.

Subscribe to:
Comments (Atom)











