function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC_LearnerSFDC_Learner 

Retrieving Report Data from the Metadata API using C#.net (Wepapplication)

HI, My using Metadata api, how can i get the custom report data with in my .net application. (i will give report name in my .net application, then a request will sent to salesforce org, from salesforce i need to get a zip file (which contains report metadata) with in my .net application). Can any one help me to do this.
Best Answer chosen by Admin (Salesforce Developers) 
SFDC_LearnerSFDC_Learner

Sorry,

 

Use like this:

 

md.FileProperties[] fp = ms.listMetadata(new md.ListMetadataQuery[] { q },21.0);

All Answers

SuperfellSuperfell

I wrote a sample for this a while back, see http://www.pocketsoap.com/weblog/2008/10/1826.html

SFDC_LearnerSFDC_Learner

I worked on given code. It gives compile time error at the statement,

md.FileProperties[] fp = ms.listMetadata(new md.ListMetadataQuery[] { q });

(I need to get Report information by just passing Custom Report Name in .NET application)

please guide me.

 

 

 

SFDC_LearnerSFDC_Learner

It works . Use

 

md.FileProperties[] fp = ms.listMetadata(new md.ListMetadataQuery[] { q ,21.0});

SFDC_LearnerSFDC_Learner

Sorry,

 

Use like this:

 

md.FileProperties[] fp = ms.listMetadata(new md.ListMetadataQuery[] { q },21.0);

This was selected as the best answer
Keith BradleyKeith Bradley

Hi,

 

I've managed to get your example running sucessfully. Now that I have the meta data for each report in our network, can I then use it to retrieve report data (i.e. is their an API call that will take a .report file and return either the SOQL query or the data from running the report)?  I suppose I can parse the xml data and generate a SOQL query  but I have a funny feeling that I would be re-inventing the wheel (or at least I hope so!  :-).

 

TIA

 

Keith Bradley

SFDC_LearnerSFDC_Learner

Yes! It is an API call.

We can construct Soql where condition using xml report data.

Here take care about all these things.

1. Check whether your Org has namespace or not.

2. Check whether it is standard report type or custom report type.

3. Check the reported object has any relation (either Master - details or lookup)....... etc.

So based on these conditions we can construct where condition. XML file is vary each of these conditions.

 

 

 

Keith BradleyKeith Bradley

Thanks for the help SFDC_Learner!

 

Do you happen to know the name of the API call?  I've only found retrieve() and deploy(). Maybe I just can't see the forest through the trees on this one!

 

Regards,

 

Keith Bradley

SFDC_LearnerSFDC_Learner

To construct the where condition from the metadata api report xml file, i did the following.

Initially, I added both partner, metadata wsdls of my org in C#.net application.

using this link we can get all the reports which are placed in Unfiled Folder.

http://www.pocketsoap.com/weblog/2008/10/1826.html

Then based on report id, we can get only specific report xml data.

using some string methods (by splitting the xml data), we can construct the where conditon.

Its an API call, bcz we are connecting salesforce from the external C#.net  application. Am i Right?

 

Keith BradleyKeith Bradley

Ah ok now we are on the same page!

 

You are correct in that I'm trying to get the report data from a C# application. I was hoping that I wouldn't half to build a SOQL generator myself ( guess I can't expect SF to do al the heavy lifting! :-) ).

 

Thanks for your help.