First working part of report generator.