This topic is locked

Changing SQL queries in realtime

11/27/2009 9:36:28 AM
PHPRunner General questions
S
swgiles author

It seems that though there is a "BeforeQueryReport($strSQL,$strWhereClause,$strOrderBy)" function on "list" pages and even "print report" pages, this function has stopped being applicable to "report" pages. I had a project which used many reports, that had a simple dropdown menu controlling the range of the SQL query, basically adding a "where" clause to it. This project was built useing PHPRunner 5.0, and while migrating it to 5.1, I was a little bit confused when I got to the events tab and there was no option for a change to the "report"'s SQL call.
And that brings me to my questions

  • Is it just me? Am I missing something obvious?
  • Is there a work-around? I'd like to be able to change the query while the website is up.
  • If it really isn't a part of PHPRunner 5.1, why was it dropped?
    Any help would be much appreciated!

A
amuro 11/29/2009

Hi, I have the same problem.
I don't know how to modify sql where clause on report page without beforequeryreport function.

J
Jane 11/30/2009

Hi,
there is no Before SQL query event for the reports. YOu can use After table initialized event for this purpose:

http://www.xlinesoft.com/phprunner/docs/after_table_initialized.htm

Check and modify gsqlWhereExpr if needed.

S
swgiles author 11/30/2009

Ah, nevermind the previous response, Don't know how that event alluded me. That should solve things, thank you!