We introduce a design method for diffractive cylindrical microlenses fabricated with a new technology similar to the fabrication of all-solid photonic crystal fibers. Unlike conventional microlenses that are fabricated with etching methods and thus have a step-index profile, the refractive index of each layer can be individually designed. We study the transmitted field of such nonperiodic lamellar phase grating. By using the fieldstitching method we can suppress the effect of periodic boundary conditions of the Fourier modal method when calculating the transmitted field of nonperiodic lamellar phase elements. We suggest an algorithm to design multilayer phase elements, which act as cylindrical lenses. We show experimental and theoretical data for a diffraction-limited lens. © 2009 Optical Society of America.