I was mistaken. Your integrand is correct, but you apparently stumbled onto the right one accidentally because your reasoning to get it is incorrect. ##\sin 90^\circ=1## and is clearly not equal to ##R/r##.
There are two angles in this problem (in calculating the magnetic field at the location of the charge). One is the angle ##d\vec{B}## makes with the the horizontal axis. Let's call that ##\phi##. And then there's the angle between ##d\vec{s}## and ##\vec{r}##, which you called ##\theta## and which is ##90^\circ##. So ##\| d\vec{s} \times \vec{r} \| = \| d\vec{s} \| \| \vec{r} \| \sin\theta = ds\,r##.
Now when you integrate ##d\vec{B}##, only the horizontal component, ##dB_z = dB \cos\phi##, survives. You should be able to explain why this is the case. And ##\cos\phi = R/\sqrt{R^2+D^2}##, which, again, you should be able to convince yourself is correct.