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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Charting running totals

Status
Not open for further replies.

mtownbound

Technical User
Jan 28, 2002
293
US

I might be beating a dead horse, but I'm trying to create line chart on a running totals field that charts the average percentage of calls that are emergency calls({@percent}) for a certain timeframe(year, month, etc). I've tried to total these and link them to a subreport but I'm having a problem with the formulas. Here are my fields:

{callcenter.date}
{callcenter.calls}
{callcenter.emergencycalls}
{@percent}======> if {callcenter.emergencycalls}= 0 then 0 else ({callcenter.emergencycalls}/{callcenter.calls})*100

These are the fields that I tried to link in the subreport, but to no avail:

{@datechange}
whileprintingrecords;
stringvar stronchangeof;
stronchangeof := (totext({callcenter.date}) + "^");

{showpercent}
stringvar strshowvalue;
strshowvalue := strshowvalue + totext({@percent}) + "^";


I'm not getting any errors, but the chart in my subreport retrieves 0 records!!!

Any suggestions???


Thanks[2thumbsup]
 
You didn't state which version of CR you're using, however, there is a "work-around" available for CR 9 as found in Crystal's KBase articles. What you're trying to do is chart based on "print time formulas" which is why it's returning 0 records. In Crystal's KBase articles search for:

cr9_charting_print_time_formulas.pdf

This will describe the work-around in detail.
 

Sorry!! Yeah, it's CR9 and I've already checked out the "Charting on Print-Time Formulas" in the Crystal KB.

If you are familiar with that article, my problem is in the "Insert and Link the Subreport" section, step 5:

Right-click the subreport and then click Edit Subreport. On the Report menu, click Selection Formula>Record. Enter the following selection formula:

{customer.customer Name} in split({?Pm-@onChangeOf},"^")

My problem is that I don't have a text field for the {customer.customer Name} variable, I am using a date field. I guess that one of my questions is how do I substitute a date for this text string or include a "in date split"??

Thanks for the response!!!!!!!!![2thumbsup]
 
Hmm...

Try (in the selection formula):

Totext({callcenter.date}) in split ({?Pm-@datechange},"^")

This should work since the datechange formula has already converted the date to text.
 

Thanks for the suggestion, but it was a nogo. Didn't return any errors and the records are there in the main report, but there is no data in the subreport.

Any other suggestions??


Thanks again!!!!!!![2thumbsup]
 
Just noticed that your variables in the formulas above aren't indicated as being "shared" in the declaration. If not, try declaring as shared variables to see if that returns the records from the subreport.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top