CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Hide empty RecordSet Forms

Print topic Send  topic

Author Message
Robert Mudryk
Posted: 04/08/2002, 5:58 PM

Using PHP4 & Templates:

I want to hide a form if it's a empty dataset... is there a more elegant
way than editing the "Process empty Recordset" section of the php and
adding $tpl->set_var("FormFormName",""); to the end of this section.

I'd prefer to be able to generate the code without having to manually
edit it after each generation

//-------------------------------
// Process empty recordset
//-------------------------------
if(!$next_record)
{
$tpl->set_var("FormTodaysSpecials","");
$tpl->set_var("DListTodaysSpecials", "");
$tpl->parse("TodaysSpecialsNoRecords", false);
$tpl->set_var("TodaysSpecialsNavigator", "");
$tpl->parse("FormTodaysSpecials", false);
$tpl->set_var("FormTodaysSpecials","");
return;
}
//-------------------------------


Alexey Alexapolsky
Posted: 04/09/2002, 3:01 AM

You can check if no records were found in Form/Open event by counting
records and
it's true, call something like. Count sql can be obtained from sSQL variable
by replacing a string
between SELECT and FROM keywords with "count(*)"

$tpl->set_var("FormItems","");
return;

in the same event

--
Alex
CodeCharge Developer


"Robert Mudryk" <rob@lasers.org> wrote in message
news:3CB23CC3.8E2A1E0F@lasers.org...
> Using PHP4 & Templates:
>
> I want to hide a form if it's a empty dataset... is there a more elegant
> way than editing the "Process empty Recordset" section of the php and
> adding $tpl->set_var("FormFormName",""); to the end of this section.
>
> I'd prefer to be able to generate the code without having to manually
> edit it after each generation
>
> file://-------------------------------
> // Process empty recordset
> file://-------------------------------
> if(!$next_record)
> {
> $tpl->set_var("FormTodaysSpecials","");
> $tpl->set_var("DListTodaysSpecials", "");
> $tpl->parse("TodaysSpecialsNoRecords", false);
> $tpl->set_var("TodaysSpecialsNavigator", "");
> $tpl->parse("FormTodaysSpecials", false);
> $tpl->set_var("FormTodaysSpecials","");
> return;
> }
> file://-------------------------------
>
>
>


   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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