August 23, 2006

Report Scraping

Back in April, the Salesforce Heretic, wrote up a method to programatically pull data out of Salesforce.com reprots (covered here).

Gareth Davies, founder and CEO of Upside-Outcomes (covered by Salesforce here), recently sent me a note that he created code based on the Heretic's post.  We agreed it would be something my readers may find useful.

Follow the link below to read his note and download the code.

Dear Mark,

One of our customers wished to analyze the relative performance of groups of sales based on a complex comparison algorithm. While we could create the analysis relatively easily, it was obvious that the majority of the programming time (and cost) would arise from making an interface to allow our client to select which sales he wanted to include in each sample set. The combinations were seemingly endless – record type, sales team, sales person, dates, product- type etc. and the definition for each set had to be stored for future use and/or modification. What was most annoying for us both was that a mechanism already exists within Salesforce.com that enables this management of object collections – it’s the reporting engine – unfortunately it cannot be accessed through the API.

Luckily the Salesforce Heretic described a method for gaining access to reports in his blog post http://sfdc-heretic.warped-minds.com/2006/04/10/progmatic-access-to-salesforcecom-reports/ from April 10th 2006. We implemented this alogorithm in two c# classes one that generates a list of reports and another that will take a report and place the results into a Microsoft DataTable.

We have always meant to release this code back to the community and thought that this would a great forum for doing so.  We have licensed the code in this distribution to be free to modify, use, include in commercial products and to re-distribute if you acknowledge its creators – for details please refer to the license conditions in the code. Remember that this code is not supported by us or Salesforce.com and there is no guarantee that the reporting interface will not change in the future. In the meantime, we hope you find it useful.

Gareth

Download ReportingSolution.zip

August 23, 2006 in technology | Permalink

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8341c299853ef00d834abb92753ef

Listed below are links to weblogs that reference Report Scraping:

Comments

Mark (and Gareth),

Cool to see you guys collaborating. It's worth noting that you need .Net 2.0 framework to use this tool.

Once I put in the Session ID and API, it succeeds in grabbing my report folders and the reports within those folders. However, when I click "Grab Report" I get the following error:

Failed to get report Data The remote server returned an error: (405) Method Not Allowed.

Posted by: Chris | Aug 26, 2006 8:20:54 PM

Thanks for this post, just wondering if this report scraping still works. I download the code and the windows xp binary gets the list of reports available but fails to get the data.

Error: Failed to get report data length cannot be less than zero.

Has salesforce closed the http web request to get the report data and if yes how did you get around this.

Posted by: George | Apr 19, 2009 11:21:21 PM

Post a comment