Solved

Sharepoint Designer 2007 Custom Page can't filter by date drop down

Posted on 2011-02-17
6
779 Views
Last Modified: 2012-05-11
Here's my problem:

I have some custom lists, each with a 'date only' field in SharePoint 2007.  I need to build a custom page to pull the data together in a table of sorts.  The catch is that I need to be able to filter by date.

Thing is, I can't seem to use the ASP dropdownlist control... as the fields don't seem to match up.  they may appear to be identical, but apparently they are not.

How does one handle these date issues???
0
Comment
Question by:scmace
  • 4
  • 2
6 Comments
 
LVL 42

Expert Comment

by:zephyr_hex
ID: 34919665
have you tried bringing the lists together using Data View web part?  you can then configure the DVWP to filter by a particular column, such as your date column.  might be worth a shot.

http://www.lcbridge.nl/vision/2009/dvwp.htm
your sources are sharepoint lists...
and you'll want to look at the section called "Working with Related/Linked Data Sources" if you have more than one list to bring into the DVWP.
there's a subsection to the section called "Creating a Data View" that talks about Filtering options.
0
 

Author Comment

by:scmace
ID: 34925679
My problem is that I'm basically trying to build a grid of data...  due to reasons I won't get into, I've got 4 lists of data.  The common things to all 4 list are Department and Date.  Unfortunately, you will not have an entry for each dept on a a given day... so I need to use some sort of date picker to pick the filter date.

My problem arises from the fact that despite the fact that it's a date only field, if you try to filter by, say, a dropdownlist bound to the dates column of one of the lists, it won't return any data IN THE SAME LIST YOU PULLED THE DATES from.  It's like something happens to the date once it is reference from somewhere outside the actual data view.  It works just fine for Department, but not date.

I've tried using a calculated column to format the date as a text string, and have had no luck from that at all.  I've also tried to use a custom workflow to do a formatted text field containing the date I need, in both lists, and still no luck.  

Date comparisons seem to be broken!

For what it's worth, I've been able to do this using InfoPath, but unfortunately we don't have forms server, and I cannot rely on the end using having InfoPath on their machine.
0
 
LVL 42

Expert Comment

by:zephyr_hex
ID: 34927483
i still recommend that you look at DVWP.  it is meant to merge or link multiple lists together and display them in a list / grid view.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:scmace
ID: 34960965
Ok, I've looked at DVWP... and I simply cannot accomplish my rendering goals with this.

So... to revisit:  I need to know how to use a date picker OR a dropdownlist control to present the user with an ability to select a date, and to correctly reference that date to filter data.  I can get a dropdownlist to work with text or numeric fields, but not dates.  Anybody know how to do this?
0
 

Accepted Solution

by:
scmace earned 0 total points
ID: 34978930
Ok, here's what I ended up doing for a solution... still not an answer to the date issue, but a workaround:

First, I created a calculated field on every list of data I was trying to bring together by day.  I tried this before, but unfortunately SharePoint decided to go ahead and treat it as a date because of the formatting... SO... I had to pick a different separator for the year/month/day... in this case, 'x'.

Here is the calculated field formula:
=YEAR(Date)&"x"&MONTH(Date)&"x"&DAY(Date)

I then created another list, 2 columns, one is a standard date, the other a string field to hold the calculated date from the list items.  For each list I wrote a workflow that checked the calculated date of the list item against the string field of the list dates... if it didn't exist, it adds it, otherwise it skips (to prevent duplicates).

So now I have a data list item with a calculated date field, and a corresponding list of dates also with a copy of that calculated date from the data lists.

Lo and behold, they match now.  So now I can populate a dropdownlist with the formatted dates(showing the normal dates), enable autopostback, and filter the data by referencing the dropdownlist with a parameter.

0
 

Author Closing Comment

by:scmace
ID: 35015367
Complexity of data rendering needs prevented the data view web part with filtering enabled from providing the best solution to this problem.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have just recently built a new SharePoint 2007 farm on a complete Windows 2008 R2 server platform and part of my standard build procedure is to implement a warm up routine, usually in the form of a script that is scheduled every morning to launch …
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now