The president sharply attacked his predecessor while insisting that his own record contained nothing but victories.