Active Report is not total

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

  • Posted 4 August 2017, 3:20 pm EST

    <span id="result_box" class=""><span class="hps">Active</span> <span class="hps">Report</span> <span class="hps">is</span> <span class="hps">not</span> <span class="hps">total</span><span class="">,</span> <span class="hps">you</span> <span class="hps">see</span> <span class="hps">the attachment</span><span class="">.</span></span><span id="result_box" class=""><span class=""></span> <span class="hps">one</span> <span class="hps">sample</span> <span class="hps">=</span> <span class="hps">sum</span> <span class="hps">of</span> <span class="hps">two</span> <span class="hps">fields</span> <span class="hps">together, can you help me ?
    2011/03/not sum question.JPG
  • Replied 4 August 2017, 3:20 pm EST


    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.

Need extra support?

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

Learn More

Forum Channels