Creat a total on a field in a Dataport

dsidsi Member Posts: 3
I am trying to create a dataport that creates a file using the G/L Entry Table. I need to include a control record at the end of the file that sums the values in the Amount field. Is this possibe?

Comments

  • SbhatSbhat Member Posts: 301
    Sure, why not. Declare a variable for Amount called TotAmt.On the dataport OnAfterExportRecord TotAmt := TotAmt + Glentry(Amount)

    Declare a variable called GlEntryFile Data type File

    CLEAR(GlEntryFile);
    glentryFile.TEXTMODE := TRUE;
    glentryFile.WRITEMODE := TRUE;
    glEntryFile.QUERYREPLACE := TRUE;
    glEntryFile.CREATE(FileName);

    glentryfile.write(format(TotAmt,0));

    Cheers !
    S.
  • dsidsi Member Posts: 3
    Thank you :D
Sign In or Register to comment.