Is there a way to create a package.xml contains all reports through Code.? I have tried listMetadata also, but could not create the xml with all the reports.

  • listMetadata requires a known folder name, so you need to enumerate the folders first, which it seems cannot be done via listMetadata, though can be queried via SOQL. Are you using Ant or Java here? Aug 19, 2013 at 15:35
  • I'm using Ant here. I want to write a .bat file to take back up of reports automatically. In time, if new reports has been added,how can i update the *.xml. Aug 20, 2013 at 6:21

3 Answers 3


You can't use the "*" wildcard on Report metadata components so the answer above is inaccurate.

You have to list out each member with FolderName/ReportName for each. The article below from Salesforce's Metadata API guide speaks to more dynamic ways to accomplish this, but it's a little beyond my understanding at the moment.



Here is alternative way to retrieve all reports.

You can’t use the wildcard (*) symbol to retrieve all reports in package.xml,

query all your reports in your report object (SELECT Name, DeveloperName, FolderName FROM Report) using Workbench/Developer Console and form it in your package.xml

Refer: http://theblogreaders.com/retrieve-unfiled-public-reports-using-salesforce-package-xml/

Thanks & Regards, Sakthivel Madesh


In the Dev Console, run:

List<Report> reports = [SELECT FolderName, DeveloperName FROM Report];
String s = '';
for (Report r : reports) {
    s += '<members>' + r.FolderName + '/' + r.DeveloperName + '</members>\n';
Task t = new Task();
t.Description  = s;
insert t;


Then go check that Task's Comments field.

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.