0

I have two date filter webparts in a page. Its name is 'FromDate' and 'ToDate'. I want to filter my custom list within this date range. How can I achieve that ?

PS: My sharepoint server and designer is 2013.

2
  • Have you tried something like this?nothingbutsharepoint.com/sites/eusp/pages/… – Jinxed Dec 19 '13 at 9:46
  • I have tried the same link already. Its for 2010 version. I was unable to find the parameters option. List View Tools is also not showing up there. – Anish V Dec 19 '13 at 9:57
1

In your browser create a new page and add your populated list to it via the web parts options on the ribbons. For this example I'm just going to use my tasks list.

1.On the same page add a date filter webpart

2.From the arrow drop down that appears when you hover over the new date filter web part, select edit web part.

3.In the options pane that appears, change the Filter name to 'Start Date', and change the default value to 'offset from today : 30 days : Before today'. Then click ok.

4.Underneath that, add another date filter and change its filter name to 'End date', and change the default value to 'offset from today : 0 days : After today'. Then click ok.

5.Now save the page in your browser, then open the page up in SharePoint designer (SPD) - in design view.

6.Once opened in SPD, click on the list web part to select it, then in the ribbon click on the list view tools > options > parameters icon.(To get "Option" tab in SP designer 2013 - select to Customize the Entire View and actually make a change to the XSL (e.g. add a comment somewhere). Then it keeps the XSLT web part options.)

7.Add two new parameters, one called 'startdate' and another called 'enddate. Leave the parameter sources and default values as default and click ok when done.

8.The parameters on the list allow us a point for our date filters to pass their values to. Now we need to set up the connections between the list and the date filters.

9.Right click on the start date filter and click add connection. In the dialog that pops up change the dropdown value to 'Send filter values to', click next.

10.Ensure that 'connect to a web part on this page' is selected in the next dialog and click next.

11.Change the target action in the next dialog to 'Get parameters from' and click next.

12.In the next dialog, select 'Start Date' from the first box, and 'Startdate' from the second box and click next. Then click finish.

13.Go through the same process with the second date filter, but in the final step select 'End date' and 'Enddate' from the boxes.

14.Now we have our date filters feeding the list with its values but we still have to set up the filter on the list.

15.Click the list web part to select it, then in the ribbon click on the list view tools > options > filters icon.

16.The filter criteria box will popup. First add a rule 'Created > Greater than or equal to > [Start date]'.

17.Then add another clause 'Created > Less than or equal to > [Enddate]'. Click ok.

18.Now save the page and open it back up in your browser.

19.It will, by default, show all tasks created in the last seven days thanks to the default setting of the start date filter. Changing these filter will filter the list according to the date ranges set.

Link to source

1
  • Thanks for your detailed reply. But, still I'm not able to find a way to add the parameter or filter conditions in custom list. It is rendered as XsltListViewWebPart. I'm able to do all the filtering with the other filter webparts except this one. :( – Anish V Dec 19 '13 at 11:21
0

The steps are available here .Change the variable name to FromDate and ToDate

6
  • Do not post link only answers. Add the important bits to your answer with a visible source link. If the link breaks your answer will not be very helpful as it looks now – Robert Lindgren Dec 19 '13 at 9:50
  • I had already suggested the link in the comments section even before andrey answered the question – Jinxed Dec 19 '13 at 9:56
  • He actually proposed it in an answer that he then revoked (but this was not easy for you to spot, so I removed my comment). Your answer is still extremely dependent on the link though. – Robert Lindgren Dec 19 '13 at 9:57
  • I have tried the same link already. Its for 2010 version. I was unable to find the parameters option. List View Tools is also not showing up there. – Anish V Dec 19 '13 at 9:58
  • I make a bold in my answer that you can get this parameters: "To get "Option" tab in SP designer 2013 - select to Customize the Entire View and actually make a change to the XSL (e.g. add a comment somewhere). Then it keeps the XSLT web part options." – Andrey Ungur Dec 19 '13 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.