Shylock appears in the court in happy mood because his bond was going to fulfill. He was knowing that if his bond will not be fulfilled according to the terms mentioned in the bond then he can claim on the court for not doing equal justice to all.
My sympathies are against him at the end of the scene because he was given the right justice. He was wanting only his bond and he got that he could not get a pound of flesh from Antonio's body. No one should ask something that which may lead to death and Shylock has done the same. So, my sympathies are against him.