Normally, if you want to put some logic to display the data in ReportViewer, you just put your code in the expression box. However, putting long and complex code in the expression box almost make the code unreadable.
This tutorial will provide you on how to create custom function separate your code and shorten the code in expression box.
1Click on empty area of your report viewer
Dim private rowCount as integer = 0 Public function RowNumberOfGroup(Byval resetRowNumber as Boolean) as integer if resetRowNumber Then rowCount = 0 End if rowCount = rowCount + 1 Return rowCount End function
3Then in expression box, you can call your custom function with this syntax:
Code.<your custom function in step 2>(parameters ... )
No comments:
Post a Comment