+ Start a Discussion
Mike SaxMike Sax 

Reports from the API?

I'd really like to query reports from the API:

1. Query the list of available reports (for example, to fill a drop-down)

2. For a given report, query the columns and rows.

I saw a screen shot from Got Campaigner that seems to indicate this is possible. Can it be done using either the partner or enterprise API? The API docs don't have any relevant hits when searching for Reports.

Thanks!

-- Mike

Message Edited by Mike Sax on 06-22-2005 01:20 AM

darozdaroz
Well, not quite the API... but if you set up your sessionId from the API into a proper cookie and make some HTTP requests to the servers you can get what you need:

Try this:

https://na1.salesforce.com/servlet/servlet.ReportList

This will give you an XML document of all the reports visible to the user. For stock reports you'll get the description as well as the name, but custom reports you'll only get the name. From there you will get the report URL which will return a HTML page of the data that you can parse through to get your rows/cols.

There may be a better way to do it - but I haven't found it... yet.
benjasikbenjasik
We are planning a better soap-based access to this list, but that link below could be used short term. Partners that are using this, we are asking them to switch to the soap-based list when it comes out.
Mike SaxMike Sax

Thanks for the tip. One idea for a slightly better way: Simulate a Post wither Click on the " Export to Excel button" to the doctor Corner in a CSV file instead of a bunch of HTML. haven't tried it get,but it seems that it should work.

-- Mike

darozdaroz

Mike Sax wrote:

Thanks for the tip. One idea for a slightly better way: Simulate a Post wither Click on the " Export to Excel button" to the doctor Corner in a CSV file instead of a bunch of HTML. haven't tried it get,but it seems that it should work.

-- Mike



I think when I tested it the Export to Excel was actually still HTML formatted... (I thought it a very cleaver trick at the time...) I'll have to double-check.
Nicolas BragardNicolas Bragard

Hello,

 

What do you mean by using a cookie with the session ID ?

I know how to read the session ID using the login method from the API. I also know how to create cookies but what do I need to add in this cookie ?

 

Thanks

CVLGCVLG

Benji,

 

Your post referred to a link that would redirect to more infor re: a SOAP-based list.  I did not see the link - can you please provide it as we are in need of exactly that solution right now.

 

Thanks!

STEVE

SimplySfdcSimplySfdc

Hi,

I also see GOT make it, but no idea how to access it. Anyone can give some input please.

rg,
sq

SimplySfdcSimplySfdc

Hi Daroz,

I've tried your suggestion and it seems not working or the URL has changed? And do you have any better way to access report from API?

regards,

sq

darozdaroz
Make sure you are already logged into the application before you go to that URL (or is doing it via code you have a session cookie set on the request). Also if you're not on the na1 server you'll need to change the url to match your instance -- emea, jp, ssl, test, etc...

I just tested it on my live org and it does work.
SimplySfdcSimplySfdc

Hi Daroz,

Thanks for your feedback, if you not mind, could you please send some code of it to community?

regards,
sq

darozdaroz
What language are you developing in, .NET? Mabye I have something handly....

Message Edited by daroz on 04-27-2006 08:54 AM

SimplySfdcSimplySfdc

yes, I use .NET. could you please post samples here, thanks a lot.

sq

SimplySfdcSimplySfdc

Hi Daroz, may I have sample of application build in .net to access report please..... thanks

sq

Gareth DaviesGareth Davies
We just posted our implementation (open source) on www.salesforcewatch.com (August 23r posting).