CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 How to insert a new Row vea PHP code

Print topic Send  topic

Author Message
beshoo

Posts: 68
Posted: 11/03/2009, 7:35 AM

Dear all
i have a Grad , i want to insert a new rows after the normal row that i get form SQL select .
i believe i have to set an attribute

        <!-- BEGIN Row -->  
        <tr {cash_account:rowStyle}>  
          <td>{description}</td>  
        </tr>  
		{cash_account:tr_td}  
 <!-- END Row -->

and in before show i have to cal TPL function or some thing please may you advice !

the target of this : i want to list tree menu in a grad and the Main row is the parent , befor show i will get the children of the parent and set an indent

  
Main Row   
         |_  New Row1  
                |_  New Row 1 1  
                        |_  New Row 1 1 1  
         |_  New Row 2  
  
Main Row 2  

if there is a solution other tan this please advice
_________________
beshoo Love PHP and CC 4.2
View profile  Send private message
idh63

Posts: 76
Posted: 11/06/2009, 7:22 AM

Hi,

I think that I am following what you want to do here.

You could write some custom code in BeforeShowRow.

Create some script to retrieve your related data with the formatting you want
Then you could choose to show {cash_account:tr_td} only if there is related data.

I don't see that you need to go anywhere near Global $tpl and in fact CCS discourages this practice in V4.x

Just use something like:
  
$db = new clsDBConnection1(); //or whatever you connection name is.  
$primary_key = $Container->ds->Record['primary_key_column_name'];  
$sql = "Select statement that retrieves related records WHERE primary_key_column_name = " . $primary_key;  
$pad_amt = 10;  
$pad = 10;  
$formatted = '';  
  
while( $db->next_record() ) {  
     $formatted[] = '<tr><td style="padding-left:' . $pad . 'px;">' . $db->f(0) . '</td></tr>';  
    $pad+$pad_amt;  
}  
  
if (is_array($formatted)) {  
   $formatted =  implode('', $formatted);   
   $Container->cash_account->Attributes->SetValue('tr_td', $formatted);  
}  

Hope this helps.
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.