create a total in a Dataport

marcoldemarcolde Member Posts: 12

i would create a dataport to export some lines of the payment journal.

the lines are not the problem, but at the end i have a integer and there i need a total of diffrent columns like amount, debitamount and creditamounts.

How can i create this total lines? I have try it but i only a got a export of every seperated line.

thanks for helping


  • Options
    AlbertvhAlbertvh Member Posts: 516

    declare 3 variable of type Decimal TotalAmount, DebitAmount, CreditAmount

    on the Payment Journal Line DataItem in the OnBeforeExport add the following code
    TotalAmount := TotalAmount + Amount;
    IF Amount > 0 THEN
      DebitAmount := DebitAmount + Amount
      CreditAmount := CreditAmount + Amount;

    You will have to add a new DataItem using the Integer table with value 1 only
    set the above variables as the Dataport Fields

    Hope this helps
  • Options
    marcoldemarcolde Member Posts: 12

    this works absolut perfect, but now i have another problem. I need to show the number without comma.
    So it creates a total with 3,00 but i need 000000300. I try it with format and a new variable TotalAmount1 but i do not know how i can delete the comma and see only the numbers.

    any help again?

    thank you very much

    TotalAmount1 := FORMAT(TotalAmount,0,'<Integer,8><Filler Character,0><Decimal,3><Precision,0:2>');
  • Options
    marcoldemarcolde Member Posts: 12
    Thanks for your help
    i found the solution and it does works.
    TotalAmount1 := DELCHR(TotalAmount1,'=',',');

    i create a new variable and than i delete the commy.

Sign In or Register to comment.