Wednesday, May 21, 2014

SharePoint 2010 Base Types, List Template and Definition IDs, and Content Types IDs

Base Types

These Base Types come from the SPBaseType enumeration.
Base TypeID
 Custom List0
 Document Library1
Not used2
 Obsolete. Use 0 for discussion boards.3
 Surveys4
 Issues List5
 List Definitions
These List Definitions come from the SPListTemplateType enumeration.
Enumeration NameDescriptionID
InvalidTypeNot used-1
NoListTemplateunspecified list type0
GenericListCustom list100
DocumentLibraryDocument library101
SurveySurvey102
LinksLinks103
AnnouncementsAnnouncements104
ContactsContacts105
EventsCalendar106
TasksTasks107
DiscussionBoardDiscussion board108
PictureLibraryPicture library109
DataSourcesData sources for a site110
WebTemplateCatalogSite template gallery111
UserInformationUser Information112
WebPartCatalogWeb Part gallery113
ListTemplateCatalogList Template gallery114
XMLFormXML Form library115
MasterPageCatalogMaster Page gallery116
NoCodeWorkflowsNo Code Workflows117
WorkflowProcessCustom Workflow Process118
WebPageLibraryWiki Page Library119
CustomGridCustom grid for a list120
SolutionCatalogSolutions121
NoCodePublicNo Code Public Workflow122
ThemeCatalogThemes123
DataConnectionLibraryData connection library for sharing information about external data connections130
WorkflowHistoryWorkflow History140
GanttTasksProject Tasks150
MeetingsMeeting Series (Meeting)200
AgendaAgenda (Meeting)201
MeetingUserAttendees (Meeting)202
DecisionDecisions (Meeting)204
MeetingObjectiveObjectives (Meeting)207
TextBoxText Box (Meeting)210
ThingsToBringThings To Bring (Meeting)211
HomePageLibraryWorkspace Pages (Meeting)212
PostsPosts (Blog)301
CommentsComments (Blog)302
CategoriesCategories (Blog)303
FacilityFacility402
WhereaboutsWhereabouts403
CallTrackCall Track404
CirculationCirculation405
TimecardTimecard420
HolidaysHolidays421
IMEDicIME (Input Method Editor) Dictionary499
ExternalListExternal600
IssueTrackingIssue tracking1100
AdminTasksAdministrator Tasks1200
HealthRulesHealth Rules1220
HealthReportsHealth Reports1221

Content Types

These content types come from the Content Type ID list.
Content TypeID
System0x
Item0×01
Document0×0101
Event0×0102
Issue0×0103
Announcement0×0104
Link0×0105
Contact0×0106
Message0×0107
Task0×0108
Workflow History0×0109
Post0×0110
Comment0×0111
East Asia Contact0×0116
Folder0×0120
Referred :- 

http://joelblogs.co.uk/2011/06/16/sharepoint-2010-base-types-list-template-and-definition-ids-and-content-types-ids

and MSDN site
 

ASP.NET User Controls

In addition to using Web server controls in your ASP.NET Web pages, you can create your own custom, reusable controls using the same techniques you use for creating ASP.NET Web pages. These controls are called user controls.
A user control is a kind of composite control that works much like an ASP.NET Web page—you can add existing Web server controls and markup to a user control, and define properties and methods for the control. You can then embed them in ASP.NET Web pages, where they act as a unit.

SharePoint USER Controls

A user control is a control that is associated with a .ASCX extension and was originally intended for a developer to re-use within a single project.  ASP.NET developers know it is really easy to create a new user control, drag and drop some controls onto a visual designer, put some logic in the control’s code-behind, and re-use the control within a single project.  This is because the .ASCX file associated with the control enables you to create markup for your control:

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Control Language="C#" 
        AutoEventWireup="true" 
        CodeBehind="EchoControl.ascx.cs" 
        Inherits="ControlsDemo.ControlTemplates.ControlsDemo.EchoControl" %>

Enter some text:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:Label ID="Label1" runat="server" Visible="false"></asp:Label>
Because you can add markup for your control, you get the nice WYSIWYG designers for your control.  This allows you to drag items from the toolbox, such as a button, a label, and a text box. 

SharePoint Server Controls


A server control is a compiled control that renders on the server.  Where user controls derive from System.Web.UI.UserControl, a server control (also known as a custom control) typically derives from System.Web.UI.WebControl.  The main difference is that server controls do not have a corresponding .ASCX control.  For some scenarios, this can be highly beneficial because the page parser does not need to parse the .ASCX control.

Creating a server control is very easy.  In Visual Studio 2010, add a new ASP.NET Server Control item to your project from the Web group.

image

The generated template is just a suggestion, you can edit the class to suit your needs.  Here is a useful control for SharePoint developers that simply shows the name of the server that is currently processing the request.

using System;
using System.Web.UI.WebControls;
using System.Web.UI;

namespace ControlsDemo
{
    [ToolboxData("<{0}:ServerNameControl runat=server></{0}:ServerNameControl>")]
    public class ServerNameControl : WebControl
    {
        protected override void CreateChildControls()
        {
            Label l = new Label();
            l.Text = System.Environment.MachineName;
            Controls.Add(l);   
        }
    }
}


Friday, October 25, 2013

NPOI

What IS NPOI
NPOI  is the .NET version of POI Java project at http://poi.apache.org/. POI is an open source project which can help you read/write xls, doc, ppt files. It has a wide application.

we can use it to
a. generate a Excel report without Microsoft Office suite installed on your server and more efficient than call Microsoft Excel ActiveX at background;
b. extract text from Office documents to help you implement full-text indexing feature (most of time this feature is used to create search engines).
c. extract images from Office documents
d. generate Excel sheets that contains formulas

Advantage of NPOI
a. It's totally free to use
b. Cover most features of Excel (cell style, data format, formula and so on)
c. Professional support service (even 24*7) from NPOI team (not free)
d. Support xls, xlsx, docx.
e. Designed to be interface-oriented (take a look at NPOI.SS namespace)
f. Support not only export but also import
g. .Net 2.0 based even for xlsx and docx (though we also support .NET 4.0)
h. Successful cases from all over the world
i. huge amout of basic examples

System Requirement

VS2010 with .NET 4.0 runtime
VS2005 or VS2008 with .NET 2.0 Runtime (SP1)
vs2003 with .NET 1.1
medium trust environment in ASP.NET


Reading the excel data:-




How to Deploy Your HTML Website on a Linux Server (Apache + SFTP)

Launching a simple HTML website on your own Linux server is easier than you might think. Whether you're sharing a static landing page or...