Dealing With Out of Control Report Growth

For most medium to large SalesForce.com implementations, the following two statements are probably true:

  • One of the favorites of most SalesForce.com users is the ease of creating new custom reports.
  • One of the headaches of most administrators is dealing with the hundreds or thousands of reports that get created, saved, and then are never used again.

Before the Force.com IDE, the only way I found to deal with unused reports was to manually move then, one at a time by using SAVE, to an “Unused Reports” folder. This is by no means a short task. Moving 50 reports can take hours. There is an Idea on the Idea board for a “Mass Move” feature.

“Mass Move Reports” Idea: http://ideas.salesforce.com/article/show/71529

In the mean time, the Force.com IDE can be used to mass archive and delete old reports. Note that if you plan on keeping the archived reports around you must mass-delete them in a different Force.com IDE project so that you are able to keep your archived copies.

What the IDE cannot do for reports:

  • Sync non-working reports down to the IDE. For example, if a report no longer runs because the object or fields in the report no longer exist it’s not possible to archive the report via the IDE. At that point you can either fix the report in the UI or just delete it.
  • Move reports between Folders. This would have been a great feature!
  • Copy reports to another Folder.

The how-to steps

Archiving Reports via the IDEscreenshot_forcecomide_newproject:

  1. Create a New Force.com Project in the Eclipse IDE (FILE->New->Force.com Project)
  2. Name the new Project, for example “Archived Reports” and click [Next]
  3. Click on “Selected Meta Data Components” and click [Choose]
  4. Scroll down the Reports section, expand it and select, one at a time, the reports you wish to Archive. Click [OK]screenshot_forcecomide_selectreports
  5. Click [Finish]

The result of the above is a “Project” in Eclipse with backed up copies of the report meta data. This is all you’ll need to recreate the reports in SFC if they’re ever needed again.

Deleting the Archived Reports via the IDE. You can also delete the reports using the SalesForce.com UI, but that can be time consuming if you have a lot of reports and they’re in different folders. This method works well to delete multiple reports at one time, though you cannot delete the folders the reports are in using this method.

  1. In the “Package Explorer” area, right-click on the “Archived Reports” project you created above and select COPY
  2. Right-click in the white space in the “Package Explorer” area and select PASTE.
  3. When prompted name the project. For example, enter “Deleted Reports” and click [OK]
  4. Right-click on the new Project name and select Properties
  5. Update the Username and Password for the project if they did not carry over from the original project
  6. Expand the Project Explorer area down to SRC->REPORTS.
  7. Expand all of the Report folder
  8. Use Shift-Click on Control-Click to select ALL of the reports to be deleted. Do not select the report folders. They can only be deleted through the web UI (unless you empty your Recycle bin first).
  9. Press the [Del] key, or click on EDIT->DELETE
  10. Click [Yes] when prompted to confirm the delete
  11. Click [Yes] when prompted to confirm deleting from the server.
  12. At this point the “Deleted Reports” project is no longer required and can be deleted.

Restoring an archived report back into SalesForce.com from the IDE is easy if the folder that the report was in still exists.screenshot_forcecomide_upoadreport

  1. Open the “Archived Reports” project created earlier
  2. Expand the project to the SRC->REPORTS section and find the report to restore.
  3. Right-click on the report and select FORCE.COM->SAVE TO SERVER
  4. Click [Yes] when prompted to save the report to the server.

If the folder does not exist in SalesForce.com you will need to copy the report metadata into a new file and upload it separately.

  1. Create a new Report Folder using the SalesForce.com Web UI. Do not give it the same name as the deleted folder.
  2. In the Force.com IDE, right-click on the Project name and select FORCE.COM->ADD/REMOVE META-DATA COMPONENTS.
  3. Click [Add/Remove]
  4. Refresh the metadata if required
  5. Expand the Reports section and check the new folder.
  6. Click [OK]
  7. You will be prompted to refresh data for the reports/folders in your existing project, even if they do not exist in SalesForce.com any longer. Click [Yes] for these.screenshot_forcecomide_copyreportmetadata
  8. Double-click on the report file (ex: report_name.report) in the Package Explorer to view the contents of the file.
  9. Select the entire contents of the file (Control-A) and copy into the clipboard (Control-C)
  10. Right-click on the new folder that you created in SalesForce.com (see step 5) and select NEW->FILE
  11. Type in a filename for the report. Note that the filename cannot have any spaces and must have end in .report (example: report_name.report). The filename does not have to match the report name.
  12. Paste the contents of the report and save the file. Ignore the “Premature end of file” error.
  13. Right-click on the new .report file and select FORCE.COM->SAVE TO SERVER
  14. Click [Yes] when prompted to save the report to the server.

Yes, there are lots of steps here and hopefully SalesForce.com will give us administrators better tools to manage outdated reports. In the mean time, the Force.com IDE can be used to clean up the massive list of reports that may be in your SalesForce.com instance.