Here are some examples to extract data form Sonar using Excel:
In case your Sonar server is secured, you will also have to manage authentication. To do so, download this example dealing with authentication.