Look at Flex Web Service API: https://www.interactivebrokers.com/campus/ibkr-api-page/flex-web-service/#api-usage
You need to generate a token once a year, but after that you can get the reports programatically.