A Data View Web part can be a great way for both developers and end users to provide some automatic and dynamic formatting for a list. To create a Data View Web part, follow these steps:
1. Open your SharePoint site and click Site Actions ➪ Edit in SharePoint Designer.
2. After SharePoint Designer 2010 opens, click Site Pages( if you want to create a new page or else just open the page where you want to add the dataview webpart go to step 4).
3.(optional) You now want to create a new Web part page. To do this, click the Web part page down-arrow on the ribbon and then select one of the predefined templates. Replace the default filename (for example Untitled_1.aspx) with your own filename (for example, myDataViewPage.aspx). Press Enter when done.
4. To edit the file, first click the file and then click Edit File in the main Web part page properties window.
5. Click one of the Web part zones, and then click the Insert tab on the ribbon and select Data View. Then select the List you want to add.
6. After SharePoint Designer updates the view with the most recent data in the list, you can add some automatic formatting.
7. For e.g. Under Conditional Formatting, select Format Column and under the Field Name, select YouNumberField. Make the Comparison value Equals. Then, add the value of 1 in the Value field. Click the Set Style button to change the background of the cell to be green. This way you can add filtering and Conditional Formatting for fields in the webpart.
8. Save the Web part page.
9. Open SharePoint, and navigate to the Web part page. You should see your new webpart.