A few years ago I wrote an article for the (now defunct) Universal Thread Magazine on how to create reports using Excel's Pivot Tables. The article was titled Programming Rubber Band Reports with Pivot Tables and showed how to create Excel Pivot Tables from a Visual FoxPro (VFP) application.
Although the article is more than 6 years old I still get questions every now and then about the code samples that I mentioned in the article. The original code samples mentioned in the article can be found here A VB.NET version of the code can be found at here
A PDF version of the article can also be found here.