How can I use a VB.NET function in a crystal reports "Details" section?
-
Hi I am relatively new to Reporting in VB.NET. Actually I am asked to retrieve a report which would basically contain some items with extensive calculations which I already constructed for on-screen display, now while creating crystal reports I didnt find the way to refer to that function so that on each retrieval of the database value, report will pass it to a function of VB.NET and then the function will return the value to display in the report i.e.
Private Function CAmt(ByVal Amt as integer) as String
Select Case Amt
Case 1
Return "One"
Case 2
Return "Two"
Case Else
Return amt.tostring
End Select
End FunctionHope you got what I mean to say. Please help me asap. Regards,
MAP Tiger Tiger Softwares Software Designer and Developer VB.NET, ASP.NET, VFP
-
Hi I am relatively new to Reporting in VB.NET. Actually I am asked to retrieve a report which would basically contain some items with extensive calculations which I already constructed for on-screen display, now while creating crystal reports I didnt find the way to refer to that function so that on each retrieval of the database value, report will pass it to a function of VB.NET and then the function will return the value to display in the report i.e.
Private Function CAmt(ByVal Amt as integer) as String
Select Case Amt
Case 1
Return "One"
Case 2
Return "Two"
Case Else
Return amt.tostring
End Select
End FunctionHope you got what I mean to say. Please help me asap. Regards,
MAP Tiger Tiger Softwares Software Designer and Developer VB.NET, ASP.NET, VFP
you can create formula(say Camt) in formula editor. Now within editor window choose database field and then use if else operator . See link Create formula in crystal report hope this helps
Rupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11
-
Hi I am relatively new to Reporting in VB.NET. Actually I am asked to retrieve a report which would basically contain some items with extensive calculations which I already constructed for on-screen display, now while creating crystal reports I didnt find the way to refer to that function so that on each retrieval of the database value, report will pass it to a function of VB.NET and then the function will return the value to display in the report i.e.
Private Function CAmt(ByVal Amt as integer) as String
Select Case Amt
Case 1
Return "One"
Case 2
Return "Two"
Case Else
Return amt.tostring
End Select
End FunctionHope you got what I mean to say. Please help me asap. Regards,
MAP Tiger Tiger Softwares Software Designer and Developer VB.NET, ASP.NET, VFP
-
Hi I am relatively new to Reporting in VB.NET. Actually I am asked to retrieve a report which would basically contain some items with extensive calculations which I already constructed for on-screen display, now while creating crystal reports I didnt find the way to refer to that function so that on each retrieval of the database value, report will pass it to a function of VB.NET and then the function will return the value to display in the report i.e.
Private Function CAmt(ByVal Amt as integer) as String
Select Case Amt
Case 1
Return "One"
Case 2
Return "Two"
Case Else
Return amt.tostring
End Select
End FunctionHope you got what I mean to say. Please help me asap. Regards,
MAP Tiger Tiger Softwares Software Designer and Developer VB.NET, ASP.NET, VFP
If you can access the Amt field in crystal report, then create a formula with some name, and go to edit(formula editor). Write the logic there.. like if Amt = 1 then "One" else if Amt = 2 then "Two" else Cstr(Amt)
Salai