hi,
In my Dataset I have 3 columns "EducationLevel","Skill" and "PreferenceType".In the report I have a field called marks.I give marks adding above 3 column values.i.e
If "EducationLevel" is (High,15 marks),(Medium,10marks),(Low,5 marks).
If "PreferenceType" is ("First" 15 marks),("Second" 10 marks),("Third"5 marks)
If "Skill" is (High,15 marks),(Medium,10marks),(Low,5 marks).
The Marks field should display aggregate of all 3 marks obtained from above 3 fields.
How can I write the expression for it?
thnx in advance

If or Select statement with custom code.

Hi,
Thnx for replying.I didnt understand what you said.Can you explain a bit?

Custom Code block - RDLC

Dim tot as integer=0
If EducationLevel="High" Then
  tot=tot+15
Else
If EducationLevel="Medium" Then
  tot=tot+10
Else
 tot=tot+5
End If
End if

If PreferenceType="First" Then
  totl=tot+15 marks
.....

Hi,
Thnx for your quick reply.I did it that way.There is an error called "EducationLevel" is not declared".This is my code.

public Function check
Dim tot as integer = 0
If EducationLevel = "A/L" Then
   tot = tot + 30
Else
If  EducationLevel = "O/L" Then
   tot = tot + 20
Else
EducationLevel = "Grade 13" Then
   tot = tot + 25
End If
End If

If PreferenceType ="First" Then
 tot = tot + 15
Else
If PreferenceType ="Second" Then
 tot = tot + 10
Else
PreferenceType ="Third" Then
 tot = tot + 5
End If
End If
end Function

In the expression in marks textbox my code is
Code.Check(Fields!Marks.Value)
But there is a error called "Unrecognized identifier" near Check.
Can you help me to sort this out?

Please add arguments,

public Function check(EducationLevel  as string, PreferenceType  as string, Skill as string) as String
 
   .....
   .....
 End Function

hi
Thnx for the reply.The custom code is working now.But there is a bulid error in marks textbox.Error is
"The Value expression for the textbox ‘textbox14’ contains an error: [BC30455] Argument not specified for parameter 'HigherEducationLevel' of 'Public Function check...
Some records does not have values for HigherEducationLevel.Is it the reason for the error?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.