Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort Formula field from ASP - URGENT

Status
Not open for further replies.

amutinu

Programmer
Oct 19, 2001
50
0
0
US
Hello All,
I am in urgent need of this solution. I have a formula field which adds up couple of other fields and then displays the sum on the report. I want to be able to sort on this field from my ASP page. I am using the RecordSortFields to sort the report. Somehow the report does not work for Formula field but when i use any other field on the report, then it works. Can someone please let me know how to solve this issue?

thanks and appreciate it


My Code:
Set SortFieldIs = Fields.Item(cint(i))

Set session("Sortfields") = session("oRpt").RecordSortFields
session("SortFields").Add SortFieldIs, cint(intsortdirection)

session("oRpt").ReadRecords
 
If the formula uses a running total variable or a summary operation, you can't sort on it. What is the formula, there may be a workaround. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Hi Ken,
The formula is a sum of other fields on the report.

This is what's in the Score Edit Formula:
{@ContactsComplete} + {@OrgComplete} + {@ProfComplete} + {@ClientAssetComplete} + {@CompletedProductsScore}


Please let me know if there is a workaround.

thanks
 
Would need to know the contents of those formulas, and any formulas mentioned in those, etc. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Here you go Ken the contents of the formula,

@Weight
0

@ContactsComplete
If {v_Report_ManagerQuestionnaire.ContactsComplete} = "YES" then
{@Weight} + 15
Else
{@Weight} + 0

@OrgComplete
If {v_Report_ManagerQuestionnaire.OrganizationComplete} = "YES" then
{@Weight} + 15
Else
{@Weight} + 0

@ProfComplete
If {v_Report_ManagerQuestionnaire.ProfessionalsComplete} = "YES" then
{@Weight} + 15
Else
{@Weight} + 0

@ClientAssetComplete
If {v_Report_ManagerQuestionnaire.ClientAssetsComplete} = "YES" then
{@Weight} + 15
Else
{@Weight} + 0

@CompletedProductsScore
({v_Report_ManagerQuestionnaire.CompletedProducts} / {v_Report_ManagerQuestionnaire.AllProducts}) * 40

@Score
{@ContactsComplete} + {@OrgComplete} + {@ProfComplete} + {@ClientAssetComplete} + {@CompletedProductsScore}

The Score is calculated correctly, now if i can only sort on the Score field, i can close this report.

thanks for your help Ken,
 
If these are the EXACT formulas, then I can't see why you can't sort on your formula. Can you sort on any of these individual formulas? Which ones? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top