Code used to generate some pdf reports automatically