We analyze the undulator radiation from planar bi-harmonic undulators with account for all principle losses in real devices. The exact analytical expressions for the UR spectrum, intensity, and the line shape are obtained in terms of special functions. The interplay of various broadening contribution is elucidated and their role is explored. Suspension and boost of certain harmonics by fine tuning the undulator parameters is demonstrated. The constant non-periodic magnetic constituents are studied to compensate the divergency of the electronic beam. The examples of harmonic generation in various undulator schemes with single and double period magnetic field are explored. Influence of inhomogeneous and homogeneous broadening on these harmonics is demonstrated. The analysis is applied to evaluate the harmonics in self-amplified spontaneous emission free electron laser.