Active Report is not total

Posted by: dongtrien on 4 August 2017, 3:20 pm EST

  • Posted 4 August 2017, 3:20 pm EST

    Active Report is not total, you see the attachment. one sample = sum of two fields together, can you help me ?

    2011/03/not sum question.JPG
  • Replied 4 August 2017, 3:20 pm EST

    Hello,

    In order to have the correct  summary values to show up for the calculated fields, please implement the following steps.

    1) Add a Field to the report with code as

    Private Sub ActiveReport_DataInitialize()
       Me.Fields.Add ("Calc")
    End Sub

    2) In the fetch data event use code as following to generate values of the calculated field

    Private Sub ActiveReport_FetchData(EOF As Boolean)
       Me.Fields("Calc").Value = Me.Fields("PerCopyPrice") * Me.Fields("Sales").Value
    End Sub

    3) Set the datafield property of the Field displaying the calculated field to the name of your calculated field eg :-Calc


    Please find the attached sample in this regard.

    Regards,
    Prantik
    2011/03/Sample-3.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels