?
Solved

Can i store a formula value in crystal reports

Posted on 2011-09-20
8
Medium Priority
?
263 Views
Last Modified: 2012-05-12
I have the result of formula in a group footer.  Can I take that result and store that value then go back up to the details and reevaluate the number?  When I try it now it just reevaluates the formula for every line when I want it to just use the value from the first result.
0
Comment
Question by:WTIAutomation
7 Comments
 
LVL 4

Assisted Solution

by:musalman
musalman earned 164 total points
ID: 36570082
Yes it will behave like this.
It is better if u calculate the footer value in sql and then use that value in detail
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36570148
What is the formula in the footer?

If the formula is the right kind it may be possible to do what you want or you could insert a subreport in the group header to get the value then use it in the detail section

mlmcc
0
 

Author Comment

by:WTIAutomation
ID: 36570218
Mimcc,
Its a formula you wrote for for the report we we're working on the last several weeks.  Its the mean in that report.  When I run the mean, i need to the take that value of mean in the group footer store that value and the reevaluate the lines in the details section using that value in another formula.    

Reference:
http://www.experts-exchange.com/Database/Reporting_/Crystal_Reports/Q_27285200.html

0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 

Author Comment

by:WTIAutomation
ID: 36570317
Just to give you the latest idea of whats going on, here is a fresh version of the report with data.  What I'm trying to do is compare the {recommenedStockQTY} field against the {TrxQTY} of every line and then mark it with a 1 or 0.  Count the 1s and then divide that by the total number of transactions.  What this will do is give me a percent of coverage, allowing me to judge then restocking quantities.  

 Inventory-for-Stock-production-r.rpt
0
 
LVL 35

Accepted Solution

by:
James0628 earned 172 total points
ID: 36586052
I haven't tried to analyze it fully, but I don't think you can do what you want in that report.  recommendedQTYStock uses a formula that uses a formula that uses variables, which are set in a formula that uses {NVTTRX.TRX_DATE} - next({NVTTRX.TRX_DATE}).  Because of that, I don't think you can use one of CR's built-in summary functions, and the variables won't have the final values for the group until the report has read the last record for the group, meaning that you won't be able to see the final value for the group when reading the detail records.

 The obvious answer would be to use a subreport in the group header to get the value for recommendedQTYStock for each group.  Then you could check that in the details.  Another option might be to create a manual query that calculated recommendedQTYStock, so that it was included in the data that the report read (so CR wouldn't have to calculate it).

 Since mlmcc worked with you on the previous question, maybe he'll will have some other insights.

 James
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 164 total points
ID: 37014204
I just looked at in some detail.  I agree with James.  You could use a subreport to calculate the recommendedQTYStock value and pass it back in a shared variable.

Other than that idea, I don't think it is possible to use the value.

mlmcc
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 37181718
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

850 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