on 04-13-2010 8:41 PM
Hi All,
I would appreciate any help I can get on this.
I have a subreport that retrieves a Foriegn Exchange rate for a specific date ( main report & sub-report are linked by date). I have no problem passing the value to the main report but when I use that value in a summarized formula field (@Princip Rem Term) I get the following error "A summary field has been specified on a non-recurring field Details: @Princip Rem Term"
Here are my formulas
Sub-report:
@FX rate
Shared numbervar FX;
FX := TONUMBER({ZFI_EXCHANGE_RATE.MRATE})
Main report:
@FX Rate
shared numbervar FX;
@PrincipalCAD
if {ZFI_TREASURY.VTBFHAPO-WZBETR} = "USD" then
{ZFI_TREASURY.VTBFHAPO-BZBETR} * {@FX Rate} else
{ZFI_TREASURY.VTBFHAPO-BZBETR}
@Principal Rem Term
{@PrincipalCAD}*({ZFI_TREASURY.VTBFHAZU-DELFZ}-{@AsofDate})
Is there a way to solve this problem? Can't I use the value I retrieved from the sub-report as a staic vlaue and summarize it??
Thanks for help...very much appreciated!!
Romeo
What you'll have to do is manually summarize the field in the formula field @Principal Rem Term using a global variable, then create another formula field that will return the global variable's value and place it where you need it on the report.
HTH,
Carl
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marshall,
Thanks for the helpful information, and it works fine, but when I try to summarize the filed @PrinccipalCAD, I still get an error message "A summary has been specified on a non recurring field.Details:@Principal CAD"
It seems that we cannot summarize a formula field with a value passed from a shared variable. Is there a way of summarizing a shared variable, without having to do a manual running total?
Thanks again!!
Romeo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Carl,
Are you saying that there's no way to pass the value from a shared variable as a static value to another formula and use it in a summarized filed??
If that's the case, I have too many fields that uses the value from the sub-report, it would take too much time to manually summarize them all.
Romeo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Romeo,
If you are trying to save off any summary data you will need add the WhilePrintingRecords evaluation time function at the beginning each formula to make sure that they are evaluated in pass 2. You need all the data and sums to have been processed first before you save them off. However, It looks like you may not need it because you are using a database field directly but I mention it just in case.
Sub-report @FX rate
WhilePrintingRecords;
Shared numbervar FX;
FX := TONUMBER({ZFI_EXCHANGE_RATE.MRATE});
Main report @FX Rate: - in order to use the shared variable, it must be declared and then used hence the FX by itself on line 3 otherwise the formula will have no result. I think this is where you ran into a problem because this formula as written in your post would have no result.
WhilePrintingRecords;
shared numbervar FX;
FX;
@PrincipalCAD - this formula can also use the shared variable FX directly instead of referencing @FX Rate. I think this is what Carl was getting at in his post. Both ways should work though.
WhilePrintingRecords;
Shared NumberVar FX;
if {ZFI_TREASURY.VTBFHAPO-WZBETR} = "USD" then
{ZFI_TREASURY.VTBFHAPO-BZBETR} * FX else
{ZFI_TREASURY.VTBFHAPO-BZBETR}
@Principal Rem Term
WhilePrintingRecords;
{@PrincipalCAD}*({ZFI_TREASURY.VTBFHAZU-DELFZ}-{@AsofDate})
I am not 100% sure if you need the whileprintingrecords declaration but it should not hurt to use it.
I think you were on the right track except for the main report FX Rate formula.
Marshall
Edited by: Marshall Lin on Apr 13, 2010 10:03 PM
Hi Carl,
Thanks for the respone...I'm not sure I fully understand your solution. Can you give me an example with the formulas I have posted.
Thanks again!
Romeo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.