2

I am building a native iOS app using the Salesforce SDK, I want to be able to show reports as graphs, but there doesn't seems to be any resources on this. Is it possible to retrieve a summary report graph from Salesforce and present it in the ViewCcontroller or is it possible to retrieve a summary report and then present that as a graph in the CV?

3

You will need to run the report via the Rest Api and return it with JSON, then extract the columns and rows and store that in arrays and then resent this information using a 3rd party sdk such as Sinobicharts or built one yourself.

4

Incredibly, there (still!) isn't yet easy programmatic access to reports, so you'd have to approximate it:

  1. Query the Report and ReportType sObjects to derive metadata about your report(s), like objects and fields
  2. Construct and execute your own SOQL query/queries to pull that data as the running user
  3. Dump it into the iOS charting library of your choice, or build your own graph

And of course, an even less-savory option: grab the CSV and scrape it yourself.

Edit: Apparently there's a new Analytics API in Winter '14. Perhaps worth a look.

  • !! OK thanks for the clarity, much appreciated. In your step 3. what do you mean by "dump", do you mean create an array of dictionaries for the JSON result string? This I can do, I've no idea what else I could do with the JSON string. – Bart Sep 18 '13 at 16:37
  • The data format for your charts will depend entirely on the charting library you pick. – Jonathan Hersh Sep 18 '13 at 16:40
  • 1
    Salesforce have in Pilot the Analytics API, that provides API access (via REST API currently) to some reports. blogs.salesforce.com/au/2013/06/whats-hot-in-summer-13.html – Andrew Fawcett Sep 18 '13 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.