Excel Automation - Data Group

niimodinniimodin Member Posts: 142
Hello Experts,
I have been trying to create a sales statistics report which I export to Excel with code below.
The client is however asking that he doesn't want the individual line but rather the Group.

Example

Instead of The equivalent Result
A = 20
A = -2
A =7 A = 25

I hope u understand the problem.

Can someone bail me out?

Thanks


ProgressWindow.OPEN(
Text000 + '\@\');
ProgressWindow.UPDATE(1,0);
TotalRecNo := "Item Ledger Entry".COUNTAPPROX;
RecNo := 0;


IF "Item Ledger Entry".FIND('-') THEN BEGIN

RowNo := '2';

REPEAT

RecNo := RecNo +1;
ProgressWindow.UPDATE(1,ROUND(RecNo / TotalRecNo * 10000,1));

xlSheet.Range('A'+RowNo).Value := "Item Ledger Entry"."Item No.";

IF ItemBuffer.GET("Item Ledger Entry"."Item No.") THEN BEGIN
xlSheet.Range('B'+RowNo).Value := ItemBuffer.Description;
END;

xlSheet.Range('C'+RowNo).Value := -"Item Ledger Entry".Quantity;
xlSheet.Range('C'+RowNo).NumberFormat := '@';
xlSheet.Range('C'+RowNo).HorizontalAlignment := -4152;

xlSheet.Range('D'+RowNo).Value := "Item Ledger Entry"."Unit of Measure Code";
xlSheet.Range('D'+RowNo).HorizontalAlignment := -4108;

RowNo := INCSTR(RowNo);
UNTIL "Item Ledger Entry".NEXT = 0;

END;
Sign In or Register to comment.