Character integral representation of zeta function in AdSd+1. Part I. Derivation of the general formula