Apr 28, 2014

Data export and exposed filter for date [ Drupal 7 Views] (in just 6 steps)

A lot of questions arise on using exposed filter for views data export, this queue helped me a little on how to fix it but not fully though, I think it would be helpful to someone out there who struggles with the same issue!

This post is all about using views exposed filters on views data export display type, I am listing a number of nodes and filtering it by user inputs for node created dates(which we use the popup calendar in Date module).
We assume that you have the needed modules below to achieve what you want.

Step 1:
Make sure you’ve enabled all needed modules and especially the date_popup that comes with date module, create a view for a content type(i.e : article), add the data export display and a page display,
Note :You won’t be able to save your view if these displays aren’t given a path.
Remember the path you give to data export display will be your file name you export, the path in your page display will be the path to help you look at what you’re going to export.

The “Format” in Data export could be an excel file to.

Step 2:
Add all needed fields in your data export display and make sure you have added the same in the page display too (add relationships/contextual filter if available).
For my convenience I set the page display to table format, which will look similar to what I am going to export, and add fields like, i.e (Title, node id, Posted date)

Step 3
Add the date popup calendar in “Filter criteria” and tick on the exposed filter option.
When you click on ‘add’ and search for the text ‘Date’ you’ll find many fields that is related to date (i.e node posted date, node updated date, etc...) you are supposed to select the “Date :Date (Node)” field that comes with the date module, take a look at the screenshot below.

Then select the options below :
“Popup” to get the popup calendar,  The granularity ,  etc…
especially the date that needs to get filter by: in our case it is the node post date which is the second red highlighted field on image

Then hit on “Apply and continue “
Finally click on the  exposed this filter option  checkbox and apply  it as shown below

Make sure you follow the step 3 completely on the page display as well.

Step 4
In the Data export display just below the path  option you'll find  ‘attach‘ where you need to attach your page display in it . which is one of the major step that we need to follow.

Step 5
Last step in our view ! select 'Parent sort' in the data export display settings .

Step 6
Now navigate to the path you've given in the page display , and you'll see the date filtering field which contains a date popup and an orange button called 'csv' or 'xls' embedded below your filtered contents.

Please add your questions or valuable comments !
Have a Great Day, Cheers!

Follow by Email