Given a finite graded poset with labeled Hasse diagram, we construct a quasi-symmetric generating function for chains whose labels have fixed descents. This is a common generalization of a generating function for the flag f-vector defined by Ehrenborg and of a symmetric function associated with certain edge-labeled posets that arose in the theory of Schubert polynomials. We show that this construction gives a Hopf morphism from an incidence Hopf algebra of edge-labeled posets to the Hopf algebra of quasi-symmetric functions. 1999 Academic Press.