index | search | no replies | posting guidelines | help login | register
Index » Products » ASP Report Wizard v2
search this forum:
:: Eval code not showing up ::    show all messagesPost a New Message | Post a Reply
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
Pages: (1)   [1]

search this forum: