but this will print the Sum only when venderid is not null.
Another approach is to group by vendorid and then calculate the Sum. You can also handle the ItemDataBound event for the textbox that should display the Sum and make all calculations by hand.
We can give you a more comprehensive solution if you send us more information about your data structure and what exactly you want your report to display.