Print Page | Close Window

Dynamic Parameter & Manual Running total

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=771
Printed Date: 04 May 2025 at 6:22pm


Topic: Dynamic Parameter & Manual Running total
Posted By: Tupacmoche
Subject: Dynamic Parameter & Manual Running total
Date Posted: 01 Jun 2007 at 5:53am
I am using a dynamic parameter and want to set a default option of "*" or all records but the default option dose not appear there. Is there a way to add it or is it not avalable for dynamic parameter? Also, I need to manually code a running total and keep getting an error msg. The code is as follows:
 
//  Returns true for the selected month
If
    mailto:%7b@May - {@May } = 1
Then
    Sum ({ACCOUNTING_BALANCE.AMOUNT_BALANCE})
else
    0;
If the month for the current record is 'true' that is it is equal to May add it to the sum otherwise don't . I have made running totals for several months each checking the condition eg. April, May but they all return the same value. Any thoughts?


-------------
Rob



Replies:
Posted By: BrianBischof
Date Posted: 01 Jun 2007 at 9:20am
I'm not sure about the default part of Dynamic Parameters. I gotta dig through my notes (which I don't have here) to see about that one.

Re the formula, have you tried printing the value of the {@May} formula on your report to see what its value is? I'm thinking it is that formula that is messed up, not the one you posted here.


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: Tupacmoche
Date Posted: 01 Jun 2007 at 10:47am
Here is the code for the mailto:%7b@May - {@May } formula:
 
//  Returns true for the selected month
If
    {ACCOUNTING_BALANCE.ACCOUNTING_PERIOD} = 11
Then
    1
else
    0;
If the value in the above field is equal to "11" this expression returns true. Now all the rows that are true should be sum with the following result.
     March              April                May
      5,348            3,444             55,000
 
The numbers in each of the above colums may represent the sum of 300 row sum up by months.
 


-------------
Rob


Posted By: BrianBischof
Date Posted: 01 Jun 2007 at 12:32pm
the formula looks fine. Again, have you put it on the report to see if it is actually returning the number you expect? These are both pretty easy formulas, there is probably something simple being overlooked.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: Tupacmoche
Date Posted: 01 Jun 2007 at 2:22pm
Check out:
 
http://www.kenhamady.com/form11.shtml - www.kenhamady.com/form11.shtml
 
This article says that you don't need the If-Then sytax just a straight boolean like:
 
{ACCOUNTING_BALANCE.ACCOUNTING_PERIOD} = 10
 
I tried this and it worked. I could still use some help with default values in dynamic parameters.


-------------
Rob


Posted By: BrianBischof
Date Posted: 01 Jun 2007 at 3:00pm
Great!

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: BrianBischof
Date Posted: 01 Jun 2007 at 7:03pm
Interestingly enough, I actually had the answer to your first question in my free online chapter on parameters (I guess I should read my own book more often!). The only way to add the "All" parameter to a dynamic parameter list is to use a Command object (writing your own SQL) and use the UNION keyword to add it to the result set. See Tutorial 4-8 at this link:
http://www.crystalreportsbook.com/Crystal_Reports_XI.asp?Page=4_9 - Dynamic Cascading Prompts


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window