DataPort group data

I have a DataPort that export all data from Purchase Invoice Lines.

I need to make a group total by Document nº on Purchase Invoice Lines:

I need my export file with one record by Document nº.

How can I do It?

Not trying to be rude, but you continue to make these posts, but don’t provide any detail about the ways you have already tried to do it. Remember, the forums don’t exist to do the work for you. They’re here to help you or nudge you in the right direction.

Tell us what you have already tried and be specific about what you are trying to accomplish.

That is not what I pretend when asking for some idears. Before asking forum, I have already tryed a lot of things, anyway…

In my Dataport I have only one DataItem Purch. Inv. Line

I created 6 new variables that keeps Quantity, depending of “Product Group Code”.

I created a similar Report and it is OK, groups OK and CREATOTAL FINE

Look what I have done in Report:

CurrReport.CREATETOTALS(Quantity,EXTRA,Cat1,Cat2,Bagos,Cachos,ValCom,VIva,TIva,VTotal);

Purch. Inv. Line - OnAfterGetRecord()

IF “Product Group Code” = ‘E’ THEN BEGIN
E := Quantity;

END
ELSE
IF “Product Group Code” = ‘1ª’ THEN BEGIN
C1 :=Quantity;

END
ELSE

IF “Product Group Code” = ‘2ª’ THEN BEGIN
C2 :=Quantity;

END
ELSE
IF “Product Group Code” = ‘B’ THEN BEGIN
B :=Quantity;

END;

IF Type = Type :: Resource THEN BEGIN

IF “No.” <> ‘’ THEN BEGIN
IF “No.” = ‘A’
THEN BEGIN
VA := Amount;
VE:=0;
VP:= (VC + VA);
END
ELSE
IF “No.” = ‘E’
THEN BEGIN
VE := Amount;
VA :=0;
VP:= (VC + VE);
END;

END;
END
ELSE IF Type <> Type :: Resource THEN BEGIN
VA := 0;
VE:=0 ;
VP:=VC;
END;

VC +=Amount;

IF “Cortador Nº” <> ‘’ THEN

Cort := Amount;

END;

Purch. Inv. Line - OnPostDataItem()

TB +=B;
TCo +=Co;

But In DataPort, some report function does not work, so I am Askin for some idears to do the that

I Need the same result But in a DataPort.

Thanks

CurrReport.? You’re making a dataport not a report did you try Curr.Dataport?

Anyway, wahy not just create a report and use WRITE and other report functions to export your data to a text file?

Yes I tried.

The problem is that DataItem Dataport is Purch. Inv. Line, so, the same record is printed in TXT file more than once (= Purch. Inv. Line line number).

The file record is correct, but repeat more than once.

I need only one recor by Purch. Inv. Line.Document nº

How can I do That?

What I would do is to create a report that groups as you want.

Then to put the code to write to a file on the section of the report that does the grouping instead of onaftergetrecord.