In this tutorial we will see how to use the DataView webpart to filter document searches. This manual is a continuation which saw the other day, and continue with the SharePoint server status Server as was the end. In this way, are understood as known certain concepts we saw in the previous manual, such as the insertion of a webpart, creating a site , etc.
First create a new site we use for our demonstration of the DataView webpart . We will call DataView Search:
After this we will open the new site with SharePoint Designer 2007 tool :
Now open default.aspx page :
DataView menu you click on the order ... Insert Data View to insert a new DataView webpart type:
As we see in the image below, is has placed us in the top right corner (highlighted in blue):
The first thing to do is select the data source. To do this, click on the webpart, and use the Data Source Library panel . Our goal is to use the documents inserted in the site created in the user manual By Content Type . This site called Test Finder. Well, our first action will be in the order click Connect To Another library ...
As we see, we pop open a new dialogue in which we choose where is our data source:
And in this pop-up dialog will insert the URL of the site (which contains the inserted documents last week):
Now we can access data from that site , and in particular panel, choose the data source is the library Documents, and click on the Show Data order:
Now select the Name field and click on Insert Selected Fields as ... We chose the option Multiple Item View ... :
As we see, our DataView webpart now displays the names of the documents created site last week (unfiltered):
Before continuing, move the webpart to the bottom left page to bring it to insert certain components below:
Our goal is to specify the name of the documents you want displayed (or part thereof). To do this, insert a type webpart Form Web Part ... as we see in the picture below, which will serve to specify the desired name value:
As we see, the form has been inserted on the back left of the page, just below our DataView webpart :
Now we have to create the connection between two webparts ( Data Form and Data View) . To do this, click with right mouse button on the form and select the option Web Part Connections ... :
In the resulting dialog box, choose the option Provide Form Values \u200b\u200bTo ... :
In the next window, choose Connect to a Web Part on this page :
In the next window, choose the target webpart ( Documents , ie our DataView webpart ), and action run, Get Parameters From:
In the next window will have to create a new benchmark for the DataView webpart (clicking on Create New Parameter ). After that, click on the button New Parameter and choose Param1 name for the new parameter:
relations now Param1 value the form field value created (T1 ):
In the final wizard window, choose the Finish directly:
We have attached the form field value with the value of parameter DataView webpart . But now is specify the filter on the DataView webpart , and define how we will use the parameter value in the filter. To do this, start by configuring the filters DataView webpart :
will create a new filter, which will specify Name as a field to filter , Contains as a method of comparison and Param1 as a filter value:
And with that we have completed the configuration of the DataView webpart . So it's time to prove its functionality. To do this, visit the search site DataView from our server with a web browser. Initially, with the form empty, there are documents:
If you specify the value doc in the form, the DataView webpart shows the documents somewhere in his name containing that value:
If we change the value of the form xl the DataView webpart responds accordingly:
On the contrary, if we use an asterisk, see that it is understood as a literal value, not as a wildcard:
Viewed as this webpart not natively support the use of asterisks as wild, let's see if it supports nested option filters. To do this, try to filter by name and title of the document at a time. With this in mind, we insert in the form a new field:
relate the value of the new text field with the new parameter Param2 the DataView webpart :
Now only create a new filter on the DataView webpart , which links to the former by an operation And , and we specify Title as a filter field, as Contains method comparison, Param2 as filter value:
After this, since there is only testing the functionality. Again, visit our site with a web browser. Initially, the DataView webpart not show documents:
If we seek documents containing a 7 in the name and 7 in the title, we see how the DataView webpart efficiently respond to our request:
0 comments:
Post a Comment