Both lattice energy and hydration energy are involved in heat of solution.
Lattice energy: The energy required to break an ionic solid into gaseous ions.
Hydration energy:The energy released when ions are separated from a lattice and dissolved in water. Hydration enthalpies are always negative.
Heat of solution:The heat released when a compound is dissolved. The heat of solution can be calculated by adding the lattice energy and hydration energy:
Heat of solution = Lattice energy + Hydration energy