This topic is locked

Report with conditions when starting

11/9/2009 5:39:02 AM
PHPRunner General questions
A
amuro author

Hi, Could anyone help?
I hope the report shows records in current month when users enter this project.
But users could use search, advsearch or showall functions to choose another month.
Thanks <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=13087&image=1&table=forumtopics' class='bbc_emoticon' alt=':rolleyes:' />

J
Jane 11/9/2009

Hi,
use After table initialized event on the Events tab to check search parameters and add custom WHERE statement if needed.

A
amuro author 11/9/2009

Hi, Jane, thank your for your reply.
But it seems have one problem.
There is no $_SESSION["table"_asearchfor] while entering first time.

I can use this condition to set up data I want to show.

Then $_SESSION["table"_asearchfor] exists after entering advsearch page, even the user doesn't choose any condition.

go back to report page, I don't know how to recognize this report must displays in current month?
Thanks <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=45292&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />

J
Jane 11/10/2009

Hi,
you can add WHERE statement only if $_SESSION["..._asearchfor"] is empty or is not set up.

A
amuro author 11/16/2009



Hi,

you can add WHERE statement only if $_SESSION["..._asearchfor"] is empty or is not set up.


Jane, Thank you for your reply <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=45446&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
There's still a problem. In the beginning, I can use this variable to add Where clause, current month.

Then go to advanced search page, no condition chosen, back to list page,

yes, still currrent month due to empty of $_SESSION["..._asearchfor"].
Once I chose a condition in search page, go back to list page, pressing show all,

or go to search page again, clear all conditions pressing search button.

After back to list page, the value of $_SESSION["..._asearchfor"] exists.
If no any condition exists, the list page shows data in current month, that's what I need. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=45446&image=2&table=forumreplies' class='bbc_emoticon' alt=':P' />

J
Jane 11/17/2009

Hi,
just check that $_SESSION["..._asearchfor"] is not empty (empty string).

A
amuro author 11/18/2009



Hi,
just check that $_SESSION["..._asearchfor"] is not empty (empty string).


Hi
The $_SESSION["..._asearchfor"] seems always empty.

I use print_r to check $_SESSION.

After search, the $_SESSION["..._asearchfor"] is Array().

Retrieving all records, the $_SESSION["..._asearchfor"] exists and its value still is Array().

Does PHPR write search conditions to SESSION variable?

Due to this situation, I don't know how to check searching condition. Thank you again. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=45498&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

J
Jane 11/18/2009

Hi,
yes $_SESSION["<table name>_asearchfor"] is an array with with search for value for each field.

$_SESSION["<table name>_asearchfor"]["FieldName1"]

$_SESSION["<table name>_asearchfor"]["FieldName2"]
You can check each search parameter or just count elements in this array .