Solved

Is it possible in Crystal Reports XI to Graph Formulas that use a running total or variable?

Posted on 2009-05-08
4
584 Views
Last Modified: 2013-11-15
I need to graph a formula that I has a running total or vaiable in it.  Is this possible?

I have the following database fields and running totals.

Database Fields:
Costcode, Tran_Date , Total_Theory
I have these grouped by date and have created a running total on Total Theory.  However my graph needs to show by Week, the value of (RUnning Total) / database field Budget.  Can't seem to graph this.

Hope this makes since and will be very appreciative of suggestions.
0
Comment
Question by:Gar_za
  • 2
  • 2
4 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 24340121
Yes through a trick.  Charts cannot use running totals since they are calculated after the charts are built.  HOwever since subreports are run at during the last pass through the report you can build arrays with the data and pass the data to the subreport.

Check this link
 https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40e7130d-aa1e-2b10-ce9f-eee2a54ff4cd

mlmcc
0
 

Author Closing Comment

by:Gar_za
ID: 31579603
I feel like I just won the lottery with this information.  Thank you.  This is exactly what I needed to get my graphs to work!
0
 

Author Comment

by:Gar_za
ID: 24341335
Ok, so got this to work when the On change is a text field.  How do I do it if the OnChange is a date field?

My On change Of  Variable has the following formula in the main report:
whileprintingrecords;
stringvar strOnChangeOf;
strOnChangeOf := strOnChangeOf + totext({cstcddtl.TRAN_DATE})+"," +"^";

When I go to the selection formula to Select CSTCDDDTL.Tran_Date base on Onchange i have the following:
{cstcddtl.TRAN_DATE} in Cdate(Split({?Pm-@OnChangeOf}, "^") [RecordNumber])

When I do this I get an error stating that "A date range is required here".
How do I make this a date range so that the selection formula will work?

Thanks
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24341468
I believe you can only use the trick through string fields because the JOIN only works on string arrays

In the main report when you add it to the array change the date to a string as
   CStr({DateField},'yyyy/mm/dd')

When you need them in the subreport convert them back
    Date(YourArray[i])

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now