CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Nested Grids using Nested Template Block

Print topic Send  topic

Author Message
Sriram Thodla
Posted: 03/04/2003, 10:05 AM

Hello all,
I like code charge's templating mechanism but find it a bit confusing
on how to use the nested templates.
Heres' what I need.

I am trying to display a grid where a program grid where the cols are track
name and rows are time blocks

Here' what I would like to display

1 2 3
9-10 Session A Session B Session C

10-11 Session D

11-12 Session E


Now here's the current template block set up I am using

<!-- BeginTrackBlock -->
{SesTime}
<!--BeginSessionBlock-->
<td>{SesName}</td
<!--EndSessionBlock-->
<!--EndTrackBlock-->

In the php, I use a nested for loop to loop through each time block,and then
trhough each track to see if it has any sessions for that time.

for every time block
for every track
for each session
if session occurs at this time block, print this session
$tpl->parse("SessionBlock",true);
}
}
$tpl->parse("TimeBlock",true);
}

No the output is where it goes awry.. Here' what I get

1 2 3
9-10 Session A Session B Session C

10-11 Session A Session B Session C
Session D

11-12 Session A Session B Session C
Session D Session E


As you can see, the entire session block gets accumulated. Setting the
parameter to false ($tpl->parse(SessionBlock,false) meant that each block
gets overwriiteten and all i get is

1 2 3
9-10 Session C

10-11 Session D

11-12 Session E

I thought of not using session blocks itself but rather introduce a dynanmic
var call RowSTarter and RowEnder that when at the begging and at the end of
the loop, print <tr> and </tr> to force a new row. Howevver, this does not
seeme elegant

<!--BeginSessionBlock-->
{RowStarter}
{SesTime}
<td>{SesName}</td>
{RowEnder}
<!--EndSessionBlock-->


Can anyone help suggest a solution using nested template blocks?







   


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.