CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Stimied: Master / Detail Report (PHP)

Print topic Send  topic

Author Message
Chip Cotton
Posted: 08/16/2002, 4:29 AM

I thought this was so easy enough to do when I was doing it
'manually', but CCS has spoiled me! Please help prevent me from going
back to "ultra edit"!

I'm looking for a way to produce a list of accounts, and under each
account, activity for that account (in a given period).

two tables: customers and activity (sales and payments)

Desired report:

Customer 1
1/03 sale $20
1/21 sale $10
3/02 pmt $30
bal $0
Customer 2
1/13 sale $10
2/02 sale $25
3/20 pmt $30
balance $5
etc.

The 'balance' is an extra which would be really nice, but the primary
focus is the list of details per customer.

From the 'ground level' a activity table query has to be looped
through every time the customer table steps through the loop.

This is easy enough to do, of course, when you're doing one customer
at a time, but I want to see multiple customers on the same page.

I'm honestly wondering: can codecharge DO this?

If so, where do I start?
Sixto Luis Santos
Posted: 08/20/2002, 12:50 PM

Hello Chip,

This is how I would do it:

1. Create your SQL as an inner join. For the example sake, say the query is
SELECT header_name,detail_name,detail_value FROM MyDetails INNER JOIN
MyHeaders ON MyDetails.header_ID=MyHeaders.header_ID;

2. Modyfy the HTML template to add your header row spanning all columns and
enclose it in a custom block:
<!-- BEGIN headTitle -->
<tr>
<td colspan="3"><B>{header_name}</B></td>
</tr>
<!-- END headTitle -->

3. Add BeforeShowRow event code to check for repeated header_name. If new
header_name, display it, otherwise hide it:

global $mydetails_myhea;
global $Tpl;
global $last_title;

$cur_title=$mydetails_myhea->ds->header_name->GetValue();

if($last_title!=$cur_title)
{
$Tpl->setvar("header_name",$cur_title);
// You must parse the template block, otherwise it won't be rendered.
$Tpl->parse("headTitle",false);
$last_title=$cur_title;
}
else
{
$Tpl->setvar("header_name","");
$Tpl->parse("headTitle",false);
}


Well, all this is easier to follow with an actual sample, so find attached a
ZIP with a CCS project in PHP showing a Master/Detail grid. You must first
create a database (in MySQL) called MasterDetail_sample and then execute the
enclosed file MasterDetail_sample.sql that creates the tables and adds some
sample data. The project is expecting an ODBC data source called
MasterDetail_sample.

Regards,

Sixto




"Chip Cotton" <please.no.email@Jail-Spammers.com> wrote in message
news:9pnpluomnmqso25dp4med3l6i3gvidckbe@4ax.com...
> I thought this was so easy enough to do when I was doing it
> 'manually', but CCS has spoiled me! Please help prevent me from going
> back to "ultra edit"!
>
> I'm looking for a way to produce a list of accounts, and under each
> account, activity for that account (in a given period).
>
> two tables: customers and activity (sales and payments)
>
> Desired report:
>
> Customer 1
> 1/03 sale $20
> 1/21 sale $10
> 3/02 pmt $30
> bal $0
> Customer 2
> 1/13 sale $10
> 2/02 sale $25
> 3/20 pmt $30
> balance $5
> etc.
>
> The 'balance' is an extra which would be really nice, but the primary
> focus is the list of details per customer.
>
> From the 'ground level' a activity table query has to be looped
> through every time the customer table steps through the loop.
>
> This is easy enough to do, of course, when you're doing one customer
> at a time, but I want to see multiple customers on the same page.
>
> I'm honestly wondering: can codecharge DO this?
>
> If so, where do I start?


begin 666 MasterDetail_sample.zip
M4$L#!!0````(`%=\%"U\1D5P6P,``&(*```0````36%S=&5R1&5T86EL+F-C
M<,U6WV_3,!!^!HG_P?(C0LLZ!@RIK;25_4)M598"CY.77%N#8P?;:=?]]=CG
M)$VR@D" Q)-]=_;==]_99_=G; F$IP/:H\1"E@MFX?S>@C1<R0%=V4Q0HL&I
M^1IFS*X&]("212'$35=I("DT.%<73!B@I-!BOLUA0*N5E'!S+1-1I(U5<3P^
M31(PIM(,GSU]TA^I+%<2I#5>?-*_U#Q%F$>/XQA5Z 1"J#F[$^ !VT++3TP4
MI7Y:9'>@*4EAP0IA?=8Q?W"&WN$A)8F2$A*+&2?R=L*,!?T.+.,N><DRMR[;
MIBB;VVR[`N8\,<MBC-PPOB!H34$;2I1VX]G6D8B:6^_H15B(<TKR$L:89]R6
M6#;\@>ETQ/(`9\R-)6I!)KL0DRH$J5;/5^ Q3IS]3MVWM&7ZCLM*[:FL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z3\V6&DKCZ$+(BR&C*B/O U#/E);,ZG\U)9-7TKB9',1U@2R?8,N;$
ME4QM:&'AFA;NULCC'V9."\DJXLI N!M1+K\81ZN:DT%T:DRS_O;$^)]>ARJ4
MIL57_Z06FVDYZ.!]+B1K_B(F_GO?&RR<:]^T03!U(?@`4$L!`A0`% ````@`
M5WP4+7Q&17!;`P``8@H``! ``````````0`@`+:!`````$UA<W1E<D1E=&%I
M;"YC8W!02P$"% `4````" !6?!0MY]+J6@\#``#3" ``$ `````````!`" `
MMH&)`P``36%S=&5R1&5T86EL+F-C<U!+`0(4`!0````(`%=\%"UN"!W8OP$`
M`$T&```1``````````$`( "V@<8&``!-87-T97)$971A:6PN:'1M;%!+`0(4
M`!0````(`(1\%"U3VRE6,@,```D2```7``````````$`( "V@;0(``!-87-T
M97)$971A:6Q?<V%M<&QE+G-Q;%!+`0(4`!0````(`%=\%"VI+E)A6@$``#(#
M```7``````````$`( "V@1L,``!-87-T97)$971A:6Q?979E;G1S+G!H<%!+
4!08`````!0`%`$4!``"J#0``````
`
end
Chip Cotton
Posted: 08/21/2002, 6:14 AM

Thank you for your excellent help.

You've been an inspiration to me, and I've ended up looking INSIDE the
Classes.php file.

The datasource object ds being in the *Navigator* class is a very good
example of why I DIDN'T find it (until you pointed it out).

May I ask, did you figure all of these functions out on your own, or
is there some CCS PHP reference that outlines (WITH EXAMPLES, CCS
PEOPLE) the use of these properties...?

   


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.