Added sql reports retrievel logic