Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2009-05-08
4
599 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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