Author |
Message |
Tupacmoche
Groupie
Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
|
Topic: Dynamic Parameter & Manual Running total 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 {@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
|
IP Logged |
|
BrianBischof
Admin Group
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
|
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>
|
IP Logged |
|
Tupacmoche
Groupie
Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
|
Posted: 01 Jun 2007 at 10:47am |
Here is the code for the {@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
|
IP Logged |
|
BrianBischof
Admin Group
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
|
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>
|
IP Logged |
|
Tupacmoche
Groupie
Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
|
Posted: 01 Jun 2007 at 2:22pm |
Check out:
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
|
IP Logged |
|
BrianBischof
Admin Group
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
|
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>
|
IP Logged |
|
BrianBischof
Admin Group
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
|
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: 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>
|
IP Logged |
|
|