Napoleon did have one legitimate child…

.. with his 2nd wife, Marie Louise of Austria.  Napoleon II (Napoleon Francois Charles Joseph Bonaparte) was the “heir apparent” to the throne.  His father dedicated him that in 1815, but it was only a title, because at the time he was only 4 years old.

(photo: Napoleon II)