Skip to Content
author's profile photo Former Member
Former Member

Crystal report shared variable dose not not show right when cross pages

Here is the situation:

Init a shared numberVar sumTotal in report header.

Calculate sumTotal in one section footer.

Display sumTotal in another section footer.

These two sections are neighbor.

When the calculate and display in the same page, there is no error.

But if they not in the same page, the display SumTotal will do the calculate again.

How can I avoid the duplicate calculation?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on May 14, 2015 at 08:47 AM

    Hi Luffy,

    Please post screenshots and also let us know what formula resides in what section.

    -Abhilash

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      CalcGrandTotals:

      whileprintingrecords;

      shared numberVar cout;

      shared numberVar GrandTotal;

      shared numberVar GrandOverheadTotal;

      shared numberVar GrandProfitTotal;

      shared numberVar GrandOverheadPct;

      shared numberVar GrandProfitPct;

      shared numberVar GrandGrossTotal;

      shared numberVar GrandMandayTotal;

      global numberVar gOverheadTotal;

      ////local numberVar lGrandOverheadTotal := GrandOverheadTotal;

      GrandTotal := GrandTotal + Sum ({@TATotalPrice},{BidSummary.BidAltCOKey});

      GrandOverheadTotal := GrandOverheadTotal + Sum({BidSummary.Overhead}, {BidSummary.BidAltCOKey});

      ////GrandOverheadTotal := lGrandOverheadTotal;

      GrandProfitTotal := GrandProfitTotal + Sum({BidSummary.Profit}, {BidSummary.BidAltCOKey});

      GrandGrossTotal := GrandGrossTotal + Sum({BidSummary.GrossTotal}, {BidSummary.BidAltCOKey});

      GrandMandayTotal := GrandMandayTotal + Sum({@ManHourDay},{BidSummary.BidAltCOKey});

      cout := cout + 1;

      if({?ShowOH&P} and not(GrandTotal = 0)) then

      (

      if({BidSummary.MarkupMethod} = 0) then

      (

      GrandOverheadPct := GrandOverheadTotal / GrandTotal * 100;

      GrandProfitPct := GrandProfitTotal /(GrandOverheadTotal + GrandTotal) * 100;

      )

      else

      (

      GrandOverheadPct := (1 - GrandTotal/(GrandTotal + GrandOverheadTotal))*100;

      GrandProfitPct := (1 - (GrandTotal + GrandOverheadTotal) / (GrandTotal + GrandOverheadTotal + GrandProfitTotal)) * 100;

      )

      );

      gOverheadTotal := GrandOverheadTotal;

      ShowGrandGrossTotal:

      whileprintingrecords;

      shared numberVar GrandGrossTotal;

      GrandGrossTotal;

      cr1.jpg (12.1 kB)
      cr2.png (4.4 kB)
      cr3.jpg (38.2 kB)

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.