Regarding Report

Hi Everyone,

i designed one report…

S.No Plan-Id Product1 Product2 Total

1 ASF 3 2 5

2 OneTIME 2 1 3

Total 5 3 8

How can i calculate those totals…i want to display in the report…

Help me wit the codings…

With Regards,

M.Madhan Kumar.

Hi Madan,

How did do the report…by AutoDesign or GeneratedDesign

If GeneratedDesign…then you can do as follows

Make the SumAll Property for the Product1 as Yes… and the In Footer added the Field Sum Control…In the Sum control properties - DataFieldName as Control Name of the Product1

Naresh Kolli.

Hi Naresh,

i m doing the report in AutoDesign…

So help me regarding this…

With Regards,

M.Madhan Kumar

Hi Madan,

Try the similar way in the Autodesign.

Naresh Kolli

Hi Madan,

In cases og the AutoDesign

If you using the direct fields from the datasource to the design - body(drag and drop) : then override the executeSection() method in the Design – Body as

public void executeSection()
{
super();
prod += table.product1; // declare prod variable in the class declaration
}

and then write the display method in the pagefooter returning the value of prod

or For the report properties — \Designs\ReportDesign1\AutoDesignSpecs — property — GrandTotal — Yes

Naresh Kolli

Hi Naresh,

Whether it ll work out for many Plan -id’s ?

Hi Naresh,

As i m using two variables called ProductOneCount and ProductTwoCount for those Product1 and Product2…

But i used those same variables for those two plan-id’s…

so there is a collision while writing the display method… as it is possible to write display method for one control oly…

how can i solve this nw…

help me plz…

HI Madan,

You have used two varibales ProductOneCount and ProductTwoCount for those Product1 and Product2…

so in the exectesction ProductOneCount += Table.Product1 and ProductTwoCount += Table.Product2…

Then write 2 display methods which return the ProductOneCount and ProductTwoCount…This what you mean…or anything different…

Naresh Kolli

Hi Naresh,

Ur right… i did those things… but in case the plan -id differs means how to display…i mean fa plan-id one i wrote two display methods called ProductOneCount and ProductTwoCount…

Nw if another plan-id occurs means how can i count fa d products…

i mean i want to use another two variables fa d counting process…

i cant use two display methods fa one control know…

With Regards,

M.Madhan Kumar.

Hi Naresh,

Ur right… i did those things… but in case the plan -id differs means how to display…i mean fa plan-id one i wrote two display methods called ProductOneCount and ProductTwoCount…

Nw if another plan-id occurs means how can i count fa d products…

i mean i want to use another two variables fa d counting process…

i cant use two display methods fa one control know…

With Regards,

M.Madhan Kumar.

HI Madan,

try this…

For the report properties — \Designs\ReportDesign1\AutoDesignSpecs — property — GrandTotal — Yes…

Naresh Kolli.

Hi Naresh ji,

this s my coding…

can u just check it out…

public boolean all(PlanID _planID, str productId)
{
;

serialNo = 0;
serialNo = serialNo + 1;
grandCountPrd1 = 0;
grandCountPrd2 = 0;
grandCountPrd3 = 0;
grandCountPrd4 = 0;

switch(tmpEnrollment.Report_planid)
{
case ‘OneTIME’:

Report_planid = tmpEnrollment.Report_planid;
rfProductPlan = tmpEnrollment.Report_productid;
if(rfProductPlan == ‘Product1’)
{
pOneCount = pOneCount + 1;
}

if(rfProductPlan == ‘Product2’)
{
pTwoCount = pTwoCount + 1;
}

grandCountPrd1 = grandCountPrd1 + pOneCount;
grandCountPrd2 = grandCountPrd2 + pTwoCount;
grandCountHead = pOneCount + pTwoCount;
break;

case ‘ASF’:

Report_planid = tmpEnrollment.Report_planid;
rfProductPlan = tmpEnrollment.Report_productid;

if(rfProductPlan == ‘Product1’)
{
pOneCount = pOneCount + 1;
}

if(rfProductPlan == ‘Product2’)
{
pTwoCount = pTwoCount + 1;
}
grandCountPrd1 = grandCountPrd1 + pOneCount;
grandCountPrd2 = grandCountPrd2 + pTwoCount;
grandCountHead = pOneCount + pTwoCount;
break;
}
element.execute(1);

return true;
}

i wrote the two plan-id’s in d switch case…

nw if plan-id changed means its not displaying…

Hi Madan,

Can you tell me how the data is stored in the table level…

Naresh Kolli

Hi Naresh,

I m using a temp table fa storing the records…

Tat temp table s designed by taking fields 4m various tables…