index | search | no replies | posting guidelines | help login | register
Index » Products » ASP Report Wizard v2
search this forum:
:: Eval code not showing up :: (14)Post a New Message | Post a Reply
Jan 25 2005, 5:09 AM
 Eval code not showing upPost a Reply
 Dreamer

View this author's profile Send this author a private message

from: New York

I have two columns in my access mdb called sales_2004 and sales_2005. I would like to create a calulated column that shows the percent of the two number. I placed the following in the text replacement for the percent colum.

%[eval]{{sales_20004}} / ({{sales_2005}} * 100[/eval]

But nothing shows up. the resulting numbers in the sales columns are aggregated and grouped by Month.

Also , once I place this code in the text replacement, how do I edit it? The only way I see to get back in to change it is to have to add it again.

Please Help.


Jan 25 2005, 6:00 AM
 Re: Eval code not showing upPost a Reply
 ghost

View this author's profile Send this author a private message Visit author's homepage

from: Washington, DC

I'm not sure but try to verify the statement below:

Your statement:
%[eval]{{sales_20004}} / ({{sales_2005}} * 100[/eval]

try this:
%[eval]{{sales_20004}} / ({{sales_2005}} * 100)[/eval]




-------------------------
Ghost
Jan 25 2005, 6:05 AM
 Re: Eval code not showing upPost a Reply
 Dreamer

View this author's profile Send this author a private message

from: New York

Nope, think the issue is that the results are totals of the sales_2004 and sales_2005, it is a summary report and I would lke the percentage of the final sum.

Jan 25 2005, 6:09 AM
 Re: Eval code not showing upPost a Reply
 Dreamer

View this author's profile Send this author a private message

from: New York

I also have my percentage results showing as 12.987743232%, how do I round this to two decimal places.

Thanks so much !!

Jan 25 2005, 7:25 AM
 Re: Eval code not showing upPost a Reply
 whichman

View this author's profile Send this author a private message Visit author's homepage

from: Laurel, MD

This is a bit tricky but try the following:

By default when you do summary reports, the summary fields are renamed using the summary types
e.g. if your fields where of the format: Field1, SUM(Field2), SUM(Field3), AVG(field1), thenyour field names will be:
FIeld1, SUM_1, SUM_2,AVG_1

so try this:
%[eval]({{SUM_1}} /{{SUM_2}})* 100[/eval]

To round numbers in javascript consider the following:

var original=28.453
1) //round "original" to two decimals
var result=Math.round(original*100)/100  //returns 28.45
2) // round "original" to 1 decimal
var result=Math.round(original*10)/10  //returns 28.5


thus you can use the following to round your values to 2 decimal places:

//for your summary report
%[eval](Math.round((({{SUM_1}}/{{SUM_2}})*100)*100)/100)[/eval]

//for regular reports
%[eval](Math.round((({{sales_2004}}/{{sales_2005}})*100)*100)/100)[/eval]






-------------------------
Master of the Game
Jan 25 2005, 7:53 AM
 Re: Eval code not showing upPost a Reply
 Dreamer

View this author's profile Send this author a private message

from: New York

That did it !! Thanks so much, did not know the names of the summary columns. Rounding also worked. Thanks !!!

Jan 25 2005, 7:59 AM
 Re: Eval code not showing upPost a Reply
 Dreamer

View this author's profile Send this author a private message

from: New York

Now it seems that my graphs do not show? Any idea?

Jan 25 2005, 9:24 AM
 Re: Eval code not showing upPost a Reply
 Dreamer

View this author's profile Send this author a private message

from: New York

And I lost my paging functionality??

Jan 25 2005, 9:44 AM
 Re: Eval code not showing upPost a Reply
 ghost

View this author's profile Send this author a private message Visit author's homepage

from: Washington, DC

Does it work without the TextReplacement?

Also, can I see your TextReplacement text!


-------------------------
Ghost
Jan 25 2005, 11:04 AM
 Re: Eval code not showing upPost a Reply
 Dreamer

View this author's profile Send this author a private message

from: New York

Here is my Text Replacement, Seems that since I added it, even other Reports have lost their graphs and ability to page.

[eval](Math.round((({{SUM_2}}/{{SUM_1}})*100)*100)/100)[/eval] %

I even created a new report with a graph and it does not show up.

Thanks,



Jan 25 2005, 11:26 AM
 Re: Eval code not showing upPost a Reply
 Dreamer

View this author's profile Send this author a private message

from: New York

If I take the percent column out of the report I get my graph and paging back. Hmmm... Any ideas?

Jan 25 2005, 12:02 PM
 Re: Eval code not showing upPost a Reply
 Dreamer

View this author's profile Send this author a private message

from: New York

Found it, looks like if any of the columns are NULL all bets are off.

Jan 25 2005, 3:15 PM
 Re: Eval code not showing upPost a Reply
 ghost

View this author's profile Send this author a private message Visit author's homepage

from: Washington, DC

Will report this bug tomorrow


-------------------------
Ghost
Jan 27 2005, 12:21 PM
 Re: Eval code not showing upPost a Reply
 ghost

View this author's profile Send this author a private message Visit author's homepage

from: Washington, DC

//for regular reports
%[eval](if(parseInt({{sales_2005}})>0){(Math.round((({{sales_2004}}/{{sales_2005}})*100)*100)/100)}else{"0"})[/eval]



-------------------------
Ghost
Pages: (1)   [1]

search this forum: