report

good morning sir,

i want to create top 10 customers by sales,i have worked on it, i am getting 14 customers by sales as an output,but i need only top 10 customers by sales and their total,there by what i have written i am sharing to you,can you please help me

Customer - OnPreDataItem()

Window.OPEN(Text000);

i := 0;

CustAmount.DELETEALL;

CurrReport.CREATETOTALS(“Sales (LCY)”);

Customer - OnAfterGetRecord()

Window.UPDATE(1,“No.”);

CALCFIELDS(“Sales (LCY)”);

IF (“Sales (LCY)” = 0)THEN

CurrReport.SKIP;

CustAmount.INIT;

CustAmount.“Customer No.” := “No.”;

IF ShowType = ShowType::“Sales (LCY)” THEN BEGIN

CustAmount.“Amount (LCY)” := -“Sales (LCY)”;

END ELSE BEGIN

CustAmount.“Amount 2 (LCY)” := -“Sales (LCY)”;

END;

CustAmount.INSERT;

IF (NoOfRecordsToPrint = 0) OR (i < NoOfRecordsToPrint) THEN

i := i + 1

ELSE BEGIN

CustAmount.FIND(’+’);

CustAmount.DELETE;

END;

IF ISSERVICETIER THEN BEGIN

TotalSales += “Sales (LCY)”;

// TotalBalance += “Balance (LCY)”;

ChartTypeNo := ChartType;

ShowTypeNo := ShowType;

END;

Pct(Numeral1 : Decimal;Numeral2 : Decimal) : Decimal

IF Numeral2 = 0 THEN

EXIT(0);

EXIT(ROUND(Numeral1 / Numeral2 * 100,0.1));

7673.cc.PNG

Did you check report 111

i have checked sir,but one thing in that report(111),he had taken two data items(customer,integer);

but i have taken only customer dataitem in my report ,based on that previous 111 report only i have written that code,i am getting the output as shown below

2072.cc1.PNG

Balu,

Are you sure you have clearly understood the logic from report 111?

Have you understand why they have used Integer table ??

I feel you need to understand the same and then you need to write the code accordingly.

i than so for getting the total in footer section?

can you suggest me ,what i have done wrong i am not getting

Activate Debugger