Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output changing on refresh?

Status
Not open for further replies.

FunkyMunky

Technical User
May 19, 2010
1
CA
Hello,

I've been having some problems with a Crystal report designed to display data regarding multiple mutual funds. Without going into too much of the details, the user is able to select several funds from an ENTITY table along with an END DATE, and it'll produce details and a few graphics based on the monthly returns.

Among the data produced would be the annualized return, cumulative return, total account value assuming a beginning $1000 value, etc. Each fund will also have a different inception date, therefore different periods will be used depending on which fund it is.

The problem is that incorrect values for the growth of the account value seems to be generated sporadically. The returns stats also suffered from the same issue until I used "whileprintingrecords", but that can't be done with the market value growth because it's charted.

The formulas used are as follows:

global numbervar AStart;
AStart := (({PERF_SEC_RETURNS.TOT_RETURN}/100)+1) * AStart;

and


whileprintingrecords;
global numbervar AStartReturn;
AStartReturn := ((1+({PERF_SEC_RETURNS.TOT_RETURN}/100))*(1+(AStartReturn/100))-1)*100;

These formulas were placed in the group headers.

Basically "AStart" (Account Start) is assigned $1,000 in the header and it is multiplied by its monthly return as a rolling total. Essentially the same thing is done for the return, but it seems without the whileprintingrecords, the incorrect values are generated more often than not.

I have read and attempted the "Charting Print-Time Formulas" paper, but that wasn't successful.

The bizarre thing is how correct values can be "forced" in once by making a negligable change to the formulas; upon re-running the report, the same incorrect values return. If one reverts the change back to its original state, then the correct values were once again appear for a single run.

Anyways any help would be appreciated. If my description wasn't clear enough, please let me know and I'll try to clarify.
 
If you intend these variables to change/accumulate across records, then you must use whileprintingrecords. You cannot drop the whileprintingrecords in order to get the charting to work. In other words the logic of what you are doing must dictate the evaluation time, not your desire to use certain functionality.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top