CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 [Resolved] Hiding panels

Print topic Send  topic

Author Message
nhbw19t


Posts: 29
Posted: 11/21/2008, 7:12 AM

Hello all,

I have a grid with 50 colums and need to hide all but the ones used in the app. This grid is a data storage table and will mostly contain blank fields, but will allow for scripts to be made to populate the table, without db updates.

table 1 = field to common name

int_1 = cpu
int_2 = sessions

I am trying to figure out a way to read in the variables from my common field name table and based on the fieldnames hide the columns.

I was thinking of populating an array.... Not really sure about the process yet.

any thoughts would be helpful
_________________
J.D. Archer
GE Transportation
View profile  Send private message
nhbw19t


Posts: 29
Posted: 11/21/2008, 1:57 PM

I figured out a way to read in my data into an array and check for it in the other array. Probably not the most efficient way, but it works. If you all have any ideas on how to make this cleaner let me know.

 $db1 = new clsDBbwnupweb();  
  
	global $data_field_array;  
	$data_field_array = array();  
	global $common_field_array;  
	$common_field_array = array();  
  
	global $commonname_field_array;  
	$commonname_field_array = array();  
  
//get fields that the script uses  
		  
	$field_sql = "SELECT collection_fld, collection_common_name ".  
		"FROM idr_scripts_fields ".  
		"WHERE scriptpkid = ". CCGetParam("script_id");  
	$db1->query($field_sql);  
	while ($db1->next_record()) {	  
		 array_push($common_field_array,$db1->f("collection_fld"));  
			$commonname_field_array[$db1->f("collection_fld")] = $db1->f("collection_common_name");  
		 }  
	  
// get the fields in the data table  
  
	$table_sql = "desc idr_script_data";  
	$db1->query($table_sql);  
	while ($db1->next_record()) {  
  
		switch ($db1->f("Field")) {  
  
			case "script_data_pkid":  
			case "scriptpkid":  
			case "dev_sub_pkid":  
			case "collection_time":  
						break;  
			  
			default:  
				array_push($data_field_array, $db1->f("Field"));  
				break;  
  
				}  
  
		}  
		  
//cycle through the fields in my script  
  
	for ($i=0; $i <= (count($common_field_array)-1);$i++) {  
		  
		if (in_array($common_field_array[$i], $data_field_array)) {  
			  
		//	echo $common_field_array[$i] . " = True<BR>";  
//----------------------------------------------------------------------------  
			if ($common_field_array[$i] == "int_1") {  
				$Component->Header_int_1->Visible = True;  
				$Component->lbl_int_1->SetValue($commonname_field_array[$common_field_array[$i]]);  
				}   

_________________
J.D. Archer
GE Transportation
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.

MS Access to Web

Convert MS Access to Web.
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.