A search for a heavy Higgs boson in the decay channel, where or , in pp collisions at a center-of-mass energy of both 7 and 8 TeV is presented. The data were collected at the LHC, with the CMS detector, and correspond to an integrated luminosity of 5.0~fb at 7 TeV and 19.6~fb at 8 TeV. The search is optimised separately for the vector boson fusion and the gluon fusion production processes. No significant excess is observed above the background expectation. The presence of a standard model-like Higgs boson with a mass in the 248--930 GeV range is excluded at 95\% confidence level. A re-interpretation of the results as a search for a Higgs singlet extension of the Standard Model is presented as well.