  We used resonant elastic x-ray scattering at the Cu $L_3$ and Dy $M_5$ edges
to investigate charge order in thin films of underdoped DyBa$_2$Cu$_3$O$_{6+x}$
(DyBCO) epitaxially grown on NdGaO$_3$ (110) substrates. The films show an
orthorhombic crystal structure with short-range ortho-II oxygen order in the
charge-reservoir layers. At the Dy $M_5$ edge we observe diffraction peaks with
the same planar wavevectors as those of the two-dimensional charge density wave
in the CuO$_2$ planes and of the ortho-II oxygen order, indicating the
formation of induced ordered states on the rare-earth sublattice. The intensity
of the resonant diffraction peaks exhibits a non-monotonic dependence on an
external magnetic field. Model calculations on the modulation of the
crystalline electric field at the Dy sites by charge and oxygen order capture
the salient features of the magnetic field, temperature, and photon energy
dependence of the scattering intensity.
