Monday, October 25, 2010

ReportItems keyword in SSRS

/*In Reporting Services:
As we know we can write the functions in Code Tab and if we need to call function we use code.functionname So in the following code I am passing ReportItems as a parameter where all report items will pass like tablename, header and footer objects name (in nut shell, all the objects what we have added on the report).
Then main thing to understand is ReportItems keyword. I know very few BI folks have worked in this area so this is new learning to all of you. I have recently fixed this issue in one of the project so sharing this with all of you.
*/


Code.FunctionName(ReportItems)


public function FunctionName(Items as ReportItems) as String
if Not IsNothing(Items("Vehicle_name").Value) then
strVehiclename = Items("Vehicle_name").Value
return Items("Vehicle_name").Value
else
return strVehicleName
end if
end function