Actually, you can already do this pretty easily within ListX. There are a few simple steps to take, and, I will attach the configuration I used for this scenario. First - Add a new header/footer to your template. This level will provide 5 objects. Two text boxes - one for start date and the other for end date. Two Links - both which pop open the calendar control contained within DNN. And the last, a Search button which will assign our criteria. The configuration is something like this: <script src="http://www.r2idnn.com/js/PopupCalendar.js"></script> <table border=0 cellpadding=0 cellspacing=0> <tr> <td><a id="calStartDate" class="CommandButton" href="javascript:popupCal('Cal','frmStartDate','M/d/yyyy', 'January,February,March,April,May,June,July,August,September,October,November,December', 'Sun,Mon,Tue,Wed,Thu,Fri,Sat','Today','Close','Calendar',0);">Start Date:</a></td> <td><input id="frmStartDate" name="frmStartDate" value="[FORMAT,[StartDate,Session],{ISEMPTY:[DATE]}]"></td> <td><a id="calEndDate" class="CommandButton" href="javascript:popupCal('Cal','frmEndDate','M/d/yyyy', 'January,February,March,April,May,June,July,August,September,October,November,December', 'Sun,Mon,Tue,Wed,Thu,Fri,Sat','Today','Close','Calendar',0);">End Date:</a></td> <td><input id="frmEndDate" name="frmEndDate" value="[FORMAT,[EndDate,Session],{ISEMPTY:[DATE]}]"></td> <td><input type=submit value="Search" id=frmSearch name=frmSearch></td> </tr> </table> As you can see, I have included the PopupCalender.js library, which is launched by pressing the Start Date and End Date links. These are wired to the frmStartDate and frmEndDate form variables. It is key to point out that I provide both the ID and NAME attributes within listX form fields. This is because - ID works best for working with Javascript, and Name works best for working with the post-back data. Additionally, I have utilized the {ISEMPTY} formatter to set a default value, in this case, to the current date. Now that I have this form, I can add some actions which will retain the selected date information. Additionally, you will want to copy this section and place it in the "No Results" detail template, otherwise it will never be visible unless some data comes back from your query. Now - We need to add a few lines of Action script - which check to see if the incoming form request contains the frmSearch button value of Search. This simply means the user has pressed the Search button. If this condition passes, simply assign two session variables to the incoming search variables. If '[frmSearch,Form]' = 'Search' * Assignment: Assign session variable 'StartDate' to '[frmStartDate,Form]'. * Assignment: Assign session variable 'EndDate' to '[frmEndDate,Form]'. Now, it comes down to simply setting up the best query for the job. I prefer to create Query Variables which handle the standard replacement of the database owner and object qualifier, as well as SQL Injection secured varaibles for consuming all Form and Querystring variables. So - the query ends up looking like this - Select * from {databaseowner}{objectqualifier}EventLog where LogCreateDate between '[StartDate]' and '[EndDate]' Thats it in a nutshell, I think you should be able to work pretty effectively from this example. Let me know if there is anything I can do to clarify the concepts. Happy Nuking! |