+ Start a Discussion
jverdjverd 

End-to-end example: List reports, retrieve report metadata, execute report, retrieve results

I'm beating my head against the wall here trying to achieve the following, using the metadata API:
  1. List reports. I'm able to list reports I created in folders I created, but that's all.
  2. Retrieve a report's metadata. I tried with
    new RetrieveRequest (14.0, null, true, new String[] {"MyFolder/MyReport"}, null);
    But got INVALID_CROSS_REFERENCE_KEY: No packages or unpackaged specified. I'm really not clear on what the sepcificFiles an unpackaged parameters should be.
  3. Run the report. I haven't seen anything that suggests I can even do this, but I'm assuming it must be possible.
  4. Retrieve the results of running the report in some standard format such as CSV or XML. I haven't seen anything that suggests I can even do this, but I'm assuming it must be possible.
I've been using the docs at http://www.salesforce.com/us/developer/docs/api_meta/index.htm, but they're kind of sketchy. Is there more complete documentation somewhere?

Thanks,
Jeff



Message Edited by jverd on 12-01-2008 01:50 PM
SuperfellSuperfell
3 and 4 are not possible.
jverdjverd
Not possible through the metadata API, or not possible through any API?

SuperfellSuperfell
Not possible via any API.
jverdjverd
Okay, backing up a bit, just to be sure we're on the same page. Forget running the report through the API. That may not actually be one of my requirements--still waiting for clarification.

If a report has been run--through the website or by a scheduled job or whatever--is it possible through the metadata API or some other API to retrieve the results of the report, say in CSV or XML?

Does the report object in the metadata API correspond to the report definition or to the data that resulted from running the report? It's the latter that I'm ultimately looking for.


SuperfellSuperfell
Its the report definition. There is no programatic access to either run a report, or get its results.
jverdjverd
Okay, then I'm confused. What is the point of getting the report definition/metadata if I can't actually get the results of running the report?


Is this something that can be queried through SOQL? If so, can you point me to a starting point for whatever API I need for that?

Thanks,
Jeff



Message Edited by jverd on 12-01-2008 04:28 PM