Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Design idea on 're'-grouping from main report -

Status
Not open for further replies.

thisisboni

Programmer
Jun 1, 2006
113
US
environ: CR10, SQL Server2000

Below is the report design (section wise) that works proper.


RH -

PH -

GH1 - tableA.col1

GH2 - tableB.col1 //initialize flag

GH3 - tableB.col2 // compute flag

Details balanace // display this row if flag <> 1

GF3 -

GF2 - SUM (balance) // display this row if flag = 1 and then reset flag

GF1 -

PF -

RF -





NOW , I need to regroup this regroup as below

GH1 - Table A.col1

GH 2 - TableB.col3

GH 3 - tableB.col4





I was thinking of passing flag value into a subreport and placing the subreport in GF1 to do this - but I am not all that sure as to wether this will do what I need.

Any inputs, ideas , help would be more that appreciated as I am under the gun to this done ---

Thanks
 
If you're trying to ask how to dynamically change grouping, use formulas as group by fields and a parameter to select which grouping to use:

So given {?MyGroupParameter} choices of 1,2, you would create 2 formulas:

// {@Group2}:
if {?MyGroupParam} = 1 then
{tableB.col1}
else
{TableB.col3}

// {@Group3}:
if {?MyGroupParam} = 1 then
{tableB.col2}
else
{TableB.col4}

Use those formulas as your group by fields.

-k
 
Hi synapsevampire:

Tx for the reply --- I hear what u're saying but I doubt wether it'll solve the issue -- lemme try and explain bit more ---

Report is
based on balance due ! - stored in Rcv table .. tableB
each Rcv belongs to an RcvGrp (both in the same table tableB)
each rcv has a payer (pyr...also in tableB) associated to it - This pyr can be either primary payer, secondary payer etc... this is identified via a priority number
So for each Rcvgrp There can be more than one payer


based on the above requirement

by Grouping is

Gh1 - Rcv Oener //tableA.col1
Gh2 - Rcv Grp //tableB.col1
Gh3 - Priority number //tableB.col2
details


reason for use of flag -
need to enforce a rule ->
If (primary payer = A and Secondary = B) then
add the balance and show it as payer A
Else
Show each Balance seperately


hence I am initializing the flag in Gh2 and computing in Gh3

//{@compute_flag}
whileprintingrecords;
global numbervar flag;

if (priority = 1 and pyr = 'A') then
flag:= 1
else if (flag = 1 and pyr = 'B') then
flag := 1
else
flag = 0;

flag;


The requirement is to keep the above rules etc.. as it is BUT group/sort as per

GH1 - Table A.col1

GH 2 - TableB.col3

GH 3 - tableB.col4


Please let me know if I am unable to outline the issue

Thanks again !!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top