Showing posts with label Webpart. Show all posts
Showing posts with label Webpart. Show all posts

Wednesday, December 28, 2011

How to create Chart in SharePoint 2010

Sharepoint 2010 make creating Chart become easier than ever before. With Chart Web Part we can creating chart quickly without coding. I this post, I will show you how to create a Chart Web Part in Sharepoint 2010.

Step 1: Create a new custom list.
You need to create a new custom list. I use the "Employee" list with 5 colume: Title, Birhtday, Male, Position and Salary.

Step 2: Create new Page
Create a new SharePoint page by clicking on the Site Action -> New Page, then name the page "Salary Chart".

Step 3: Add the Chart Web Part to the page
From the "Editing Tool" ribbon group, select Insert->Web Parts. The select "Chart Web Part" under "Business Data" Categories and press the Add button. Finally click "Save & Close" to save the page.


Step 4: Connect Chart to SharePoint List
Now you need to bind the chart to the data source. In the Chart Web Part, click on Data & Appearance. On the next page, click on Connect Chart to Data.


 Select "Connect to a List" and click "Next" as show in the figure bellow:


 On the next page, select Employee list from the dropdownlist and click Next.


Click Next.

Step 5: Bind Chart to data
From "Y Field" drop down select "Salary", from "X Field" drop down select "Title". These 2 column are the fields from Employee list. Click "Finish", as show in figure below


 The chart is now show on the Salary Chart Page as shown in the figure bellow:

 Step 6: Customize the Chart
On the Chart Web Part, select Data&Appearance. On the next page, select Customize Your Chart. The the Select Chart Type, select "Custome" on the "Chart Type Categories" panel and select Column under the "3D Chart Types" on the "Chart Template" panel, then click Next. (You can select any chart type you like)

On the next page, I customize the appearance them of the chart and finally click Finish.


And the bellow figure is the final appearance




 Hope this helps!!!

Friday, December 2, 2011

Create a Hello World web part by Visual Studio 2010

This post provides the steps for creating a basic custom Sharepoint 2010 Web Part  that can be added to your site pages by Visual Studio 2010

Step 1: Launch the Visual Studio 2010. On the File menu, click on New->Project.

 On the left panel, Select Visual C#, Sharepoint 2010. On the right panel, select Visual Web Part. Then, type the project and soluction name as well as the location.


Step 2: Specify the URL that the project will be deployed to.






Step 3: Add the following code to the file "VisualWebPart1UserControl.ascx.cs"


protected void Page_Load(object sender, EventArgs e)
{
            Label lb = new Label();
            lb.Text = "Hello world";
            this.Controls.Add(lb);
 }


Step 4: On the Solution Explorer, Right click on the Project and select Build. Right click on the project again and click on Deploy.


Step 5: Open the web browser and locate to your Sharepoint site. On Site Action menu, click on Edit Page. On Editing Tool tab, select Inser->Webpart




Step 6: Select Custom on Categories tab and click on the web part we've just created.




Then, click Add and then click on Save button on the left corner, we have the following result




Hope this helps!

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews