Thursday, 30 May 2013

SharePoint 2010 - DataSource

Datasources in SharePoint

Datasource is used in SharePointDesigner are 4 types. Those are 

1.XML  
2.Database  
3.List 
4.Webservice

Using datasource with XML File

Open  SharePointDesigner2010 ---> click on Open site  or Recent Sites -->
 Give our site url --->
 Select sitepages ---> 
  Rightclick and create a new .aspx page --->
  Create.

Right click on our new aspx file and select Edit file in Advanced mode ---> 
 Insert --> 
 Table ---> 
 Draw table as you required. Design the page.

From leftside navigation select 'Datasources' --> 
From topmenu -- select 'XML File Connection'  ---> Click on browse and choose where is our required xml file and select the file ---> OK. 
It will asking you a dialog box that file want to move to our sitelocation. You should say yes. Now xml file will be in site collection. 
Goto Our XMLDemopage and click on Insert menu---> 
DataView ---> 
Select our xml file and click on OK.

* XML File will be added to our page in Data source details section at right side.
* Now you can select xml file or required columns from datasourcedetails and drag to the page. 
* Now select the list and goto Datasoruce details
 ---> Select XML File 
---> Insert Selected Fields as 
---> choose your required option as below

1.Single item view : Displays each record in one page.
2.Multiple item view : This is bydefault option. All items in a page.
3.Single Item Form: Displays single item in one page as edit item mode.
4.Multiple Item Form: Displays all items in one page as edit item mode.
5.New Item Form : Displays as New item form mode with save option.

================================
2. Using Datasource - Database

SPD --> 
SitePages --> 
Createnewpage [dbsample.aspx] --> 
open in Advanced mode -->  
  Design the form as you required --> 
insert table ---> 
Now select Datasources navigation ---> 
click on 'Database Connection' in top menu ---> 
Click on 'Configure Database Connection' --->
 Enter the sqlserver server name Ex: 'HANU-PC\SQLEXPRESS'   and select the provider ---> Sqlserver/ oracle.
  Give the authentication details ---> 
Select the Database from list   ---> 
select the required tables and click on Finish.

* Now Datasource Properties dialog box opens. If you want any conditions like where then you select 'Filter' option to write the code.
* Filter --> select the field name,  select the comparison, value, And / Or ....
* Sort ---> This option is used for sorting the table as selected column.


* Now check the Datasources page you will find newly created database connection under DatabaseConnections option. 
*Now goto our dbsample.aspx page. 
Insert --> 
Dataview--> 
Select our database connection---> 
Table will be displayed in the page. Check at right side also.

*Select the table in the page ---> 
'Options' topmenu --->
 'Inline Editing' Ribbon ---> 
Show Edit item links : For editing the record
---> Show Insert item links : For inserting new record
---> Show Delete item links : For deleting the record
---> Synchronize commands  //default option

================================

3. Using Datasource - List 

* Another type of datasource is List.
* Here we'll create a list and that list data will be using to newly created pages * Create a custom list in Browser or SPD 
* Create required columns and Add some records  to the list. [studentlist]
*Open SPD ---> 
Sitepages ---> 
New page --->
listdemo.aspx ---> 
Edit in Advanced Mode ---> 
Design the page with tables and make colorful.  ---> Insert ---> 
Dataview ---> 
Select the list ---> 
List data is displays in listdemo.aspx page.

================================

4. Using Datasource - Webservice
** Webservice like a class library. Service.asmx file creates.

Open Visualstudio 2010 ---> 
File ---> 
New --> 
website ---> 
Goto .NET Framework3.5 ---> 
ASP.NET WebService ---> 
Browse for our location ---> Filename ... OK

Open App_Code/Service.cs and write the follow code //Bydefault it is opens

Write the following code

  [WebMethod]
    public string HelloWorld() {
        return "Hello World";
    }
    [WebMethod]
    public int add(int a, int b)
    {
        return a + b;
    }
    [WebMethod]

       public int subt(int a, int b)
    {
        return a - b;
    }
   
    public int mult(int a, int b)
    {
        return a * b;
    }

---------------------------------------
* When you run [f5] this application   http://localhost:3358/ws1/Service.asmx will be opens and you will found HelloWorld, add, subt methods and if you click these methods they will run and produce out put in xml format. But mult method have no [WebMethod] option so it could not be visible in service.asmx.

================================
Ex : 2  

Add the namespaces :
using System.Data;
using System.Data.SqlClient;

write the code in webmethods as

[WebMethod] 
public DataSet MyData( )
{
 SqlConnection con=new SqlConnection("Data Source=Hanu-PC/SQLEXPRESS;Initial Catalog=MyDatabase;Integrated Security=True");
string sql1="select * from emp";
SqlDataAdapter da=new SqlDataAdapter(sql1,con);
DataSet ds=new DataSet();
da.Fill(ds);
return ds;
}


Build and Run (F5) the Webservice. 
Test the method, copy the URL.

*SPD ---> 
SitePages ---> 
Create a new page [webservicedemo.aspx] ---> Design ---> 
Datasources ---> 
In the ribbon click on SOAP Service connection service description location. Click on Connect now. 
*In the operation select MyData ---> OK
* In the datasources you will find new section 
(Soap Services) under that you will find your webservice.
 ---> Now in the page click on insert menu click on dataview, under soap services section 
---> Click on your webservice.
It will be place in the page or from the datasource detail section. Select yours required columns click on insert selected field as dropdown, click on multiple view. It will desplayed on the page, save and close.
*  ========= * ========= *  ======== *

Saturday, 18 May 2013

SharePoint - List - Issue Tracking

Lists
  Lists are 2 types 

1. Lists: Uses for storing huge amount of information
2. Library: Uses for storing short amount of information

Types of Libraries 
==============


1.Document Library
2.Picture Library
3.Slide Library
4.WikiPage Library                                        
5.Asset Library          
6.Form Library
7.Report Library

Types of Lists
==========================
1.Announcements
2.Contacts  
3.Links
4.Team Discussions  
5.Tasks  
6.Calender
7.Issue Tracking  
8.Project Task Lists  
9.Survey
10.Custom List in Datasheet view  
11. Custom List
12.Import Spreadsheet  
13.External List

* ========= * ========== * 

Lists--->  Issue Tracking

Using for posting the issued and concerned persons closing the issues.

Ex: Project point of view Testing team will be postin the issues and will be responsed by the concerned person. After responce of that person testing team once again checking and decides it should be closed or not.

SiteActions --> MoreOptions --> Lists --> IssieTracking --> MoreOptions
Name: Project A Issues
Description: Testing results for Project A Create.......

  Click on Add New item option-->

Title    : Login Page
Assigned to : Hanu
Issue Status: Active / Resolved / Closed
Priority    : High / Normal / Low
Description : After login all users will get the same username
Category    : Cat1 / cat2 / cat3
Related Issue:   If any issue click on Add button
Comments    : May be hotcode error
Due date    : give the date for solve the issue

 Click on Save button

* When Assigned user (hanu) logged in and checking issue tracking he will find this issue and he will rectify the error and modify status as Resolved.
* Next time Testing person or issue tracking creator checks this issue next time and if the issue is solved then he update this issue as Closed or any new issue raises he will post new issue.

================================
Library - PictureLibrary
2.Picture Library:  This is also same like document library but here we can upload only pictures and Slide show. And showing pics as Thumbnail mode.
Library is like a folder. with in a folder we can create any kind of files same as here with in lib also we can upload any kind of files. But the only one difference is that with in a folder we can create another folder but with in a library we can not create another library.

SiteActions --> MoreOptions --> Library --> Picture Library --> More Options -->  

Name Project A Images
Description Required images for project A
Navigation Yes / No
Version History Yes / No ==>  Create

Here New option is only for creating folders but not to create new picture. We can only upload pictures by clicking on the Upload option 

Browse the image , Give the values for Name, title, Date picture taken ,Description and Keywords for searching.

Like you can upload some more images to your page. Now you can view images by clicking on any image title or you can view the slide show by Actions --> View Slide Show 

================================ 3. Wiki Page Library


Mainly uses for creating internally connected pages. It is like a ebook. It contains pages with text, image and controls with links from one page to other.

Ex : 
SiteActions --> More Options --> Library --> WikiPageLib --> Name .... Create

By default it has 2 pages. 1.Home 2. How to use This Library

For editing any page select page and click on Page Menu and select Edit option or direct click on Edit Page icon.

Here you can change the font styles, font size, colors, alignments and textlayouts.

For more materials and tutorials contact me @hanugopal@gmail.com


Friday, 17 May 2013

Sharepoint Lists

             SharePoint Tutorial

Lists are 2 types

1. Lists: Uses for storing huge amount of information
2. Library: Uses for storing short amount of information

Types of Libraries
================

1.Document Library 
2.Picture Library 
3.Slide Library 
4.WikiPage Library 
5.Asset Library  
6.Form Library 
7.Report Library

Types of Lists
==============
1.Announcements  
2.Contacts  
3.Links
4.Team Discussions 
5.Tasks  
6.Calender
7.Issue Tracking 
8.Project Task Lists 
9.Survey
10.Custom List in Datasheet view  
11. Custom List
12.Import Spreadsheet  
13.External List

* ========= * ========== * 
  Library --> 1. Document Library

Site Actions --> More Options --> Library --> DocumentLibrary --> Moreoptions
Name, Description:..
Navigation: Display this document on the quicklaunch: Y / N
Document Version history : Y / N
Document Template : Choose template ex: word/excel/ppt ...
click on create button.

   You will be redirected to new document library page. Here you can add new documents by upload documents( 1 doc / multiple docs).

you can directly create new document by documents --> new document--> ...
here bydefault document only opens (excel / word selected when doc lib creates)

If we want to change any option like versioning or doc name or any option go
library --> lib settings --> general settings --> title,desc / version

================================
Lists : 1.Announcements

Announcements will be using for giving the announcements as project wise or team wise company wise.

SiteActions --> MoreOptions --> Lists --> Announcements --> Moreoptions
Name , Description, Navigation ..... Click on create

Add new announcement : for creating new announcement.
Title:announcement title
body:announcement body
expires:date of expire for announcement
================================
For more information mail me : hanugopal@gmail.com    or @9059971804