CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Dynamically remove WHERE clause

Print topic Send  topic

Author Message
karen

Posts: 99
Posted: 11/01/2009, 8:17 PM

Hi all,

I am sure this is something very easy but I can't seem to find out how to do it. There's help on how to dynamically modify the where clause but I want to dynamically remove it in a report.

I have tried in "Before Build Select" and "Before Execute Select" events with this:
$formname->DataSource->Where = "";

I turned on db_mysl debug and find that the where clause is still there. Pls help. Any clues is much appreciated. Thanks!
View profile  Send private message
karen

Posts: 99
Posted: 11/02/2009, 2:01 AM

I'm guessing it's because I'm using SQL datasource type instead of Tables so I have to replace the whole SQL statement. I'll try that unless someone else knows another way. Thanks!
View profile  Send private message
idh63

Posts: 76
Posted: 11/05/2009, 2:38 PM

Hi;

Here's how I do it.

I create the sql statement for the form and leave out a where clause.

Then in BeforeExecuteSelect I control if I want a where clause or not.

something like.....

if ($trigger_where === true) {  
    $Component->ds->Where = "my where clause AND content='stuff'";  
}
View profile  Send private message
idh63

Posts: 76
Posted: 11/05/2009, 2:40 PM

I should add..... your version of $formname->DataSource->Where = ""; is good also, as you know.
View profile  Send private message
karen

Posts: 99
Posted: 11/05/2009, 6:29 PM

Thanks for your suggestion, idh63. I'll try and see if that works with SQL datasource type.
View profile  Send private message
karen

Posts: 99
Posted: 11/09/2009, 5:21 PM

Nope, it looks like I have to replace the SQL and not the WHERE for a SQL datasource type. So I replace $Component->ds->SQL with the main SQL statement without the ORDER BY in the Before Execute Select event. Thanks for your suggestion, it was worth a try!
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.