This topic is locked

A Dropdown to select a Date Range for a Report

5/16/2008 12:07:05 PM
PHPRunner General questions
V
voicemagic author

How can I add a dropdown to select rows for a specific month & year (Jan 2008, Feb 2008, etc) for a report, before the report executes?
I have a column (call_date) and want to allow the user to select the month & year before running the report.

J
Jane 5/19/2008

Hi,
use advanced search page for this purpose.

To redirect to the advanced search page before add following code to the Report page: Before process event:

if (@$_REQUEST["a"]!="search" && @$_REQUEST["a"]!="advsearch")

{

header("Location: TableName_search.php");

exit();

}

V
voicemagic author 5/19/2008

Hi,

use advanced search page for this purpose.

To redirect to the advanced search page before add following code to the Report page: Before process event:


I tried your solution & I must be missing something.

I substituted "ivr_call" for "Tablename", but it only used the criteria that I put in the advanced search & gave me a list from the ivr_call table instead of further applying the criteria to the report.
I could have also misled you on what I needed, so this is my current report query:
[codebox]SELECT

`user`.group_id AS `Group`,

ivr_call.observer_id AS Super,

`user`.pass_code AS Employee,

`user`.name AS `Employee Name`,

ivr_call.call_date AS `Date`,

ivr_call.points_awarded AS Points,

ivr_call.alias_id AS Foreman,

ivr_call.quiz_number AS SmartCard,

ivr_call.ydr_code AS YDIR

FROM `user`

, ivr_call

WHERE `user`.pass_code =ivr_call.employee_id AND ivr_call.company_id =9411 AND `user`.emp_dir ='brandt'

ORDER BY `user`.group_id, ivr_call.observer_id, `user`.pass_code, ivr_call.call_date[/codebox]
It currently returns ALL rows in the ivr_call table for a selected company.

I am also matching against the "user" table to pick up employee name and group information.
My report currently lists ALL ivr_call rows , regardless of date, for a specific company (9411).

What I am trying to do is to allow the user, before the report actually runs, to select only those rows within a specific date range (ivr_call.call_date).

J
Jane 5/20/2008

Hi,
it's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages.

I'll find what's wrong with your projects inspecting it at Demo account site.