Stocks notched a solid gain, fueled by a succession of positive economic reports and a strong start to the first-quarter earnings season.