SSRS Export can be run from the command line.
The file to execute for the command line is ssrsexp.exe located in the installation folder.
typically the installation will be in the folder
c:\program files\2nd rock\SSRSExport
executing ssrsexp.exe without any options will show the help information:
SSRSExp
-------
/c:<ssrs server> Connection URL to SSRS Server
[/u]:username Username to connect to server
[/p]:password Password to connect to server
Note if /u & /p are not specified connects as current user
[/f] Connect using forms authentication- must specify /u /p
[/r:SSRS folder] Root SSRS folder
[/e:folder] Export items to folder
[/o] Overwrite existing files (used with /e)
[/z:zip filename] Export items to zip file
[/d] Add timestamp to zip filename
[/b] Create empty folders
[/s] Recuse subfolders folders
[i:<X>] Items to export
x=A Export All items
x=R Export reports
x=E Export resources
x=M Export model
x=D Export datasource
x=S Export dataset
x=P Export report part
Note
can export multiple items eg. export reports and resources use /i:RE
If no item is specified, default option is export only reports
You must specify the following
Command line option |
Description |
Example |
/c:<ssrs server> |
SSRS connection url |
/c:http://a_server/reportserver |
/r:<root server> |
folder on SSRS server |
/r:/ |
/e:<folder on computer> |
folder on computer |
/e:"c:\ssrs reports" |
all other command line parameters are optional.
Notes:
1.Command line options are case insensitive.
2.Items with spaces in them must be enclosed in quotes
eg. export folder is called c:\ssrs reports
you would use the command line option /e:"c:\ssrs reports"
3.You must choose either export (/e:) and/or zip (/z:) as an export option
4.The default is to export only items in the folder not sub folders. If you want to export sub folders use the option /s
5.The default is not to overwrite current items in the export folder. To overwrite items use the option /o
6.If user name and password are not specified it will use the current user.
7.If the items to export (/i:) is not specified only reports are exported.
8.Exporting all item types is done using /i:a
9.Exporting allows multi item selection for example export only resources use /i:e to export reports and resources use /i:re
Examples
In the following examples the SSRS server url is http://prod:8080/ReportServer_S8R2 note if the port is not 80 you must specify the port number as in this example the port is 8080
These examples assume you are in the SSRSExport folder or have added the c:\program files\2nd rock\SSRSExport to the path. In the examples below items that have changed are highlighted in bold.
1. Export reports from the root folder (/) on the SSRS server to the folder c:\SSRS sales using the current user
ssrsexp /c:http://ian-xps:8080/ReportServer_S8R2 /r:/ /e:"c:\SSRS sales"
Notes:
/o is not specified so if an item exists already on the disk the item will not be exported.
/I: is not specified so only reports are exported
/s is not specified so only the current folder will only be processed. To process sub folders also use /s
/e: the folder is enclosed in quotes as it has spaces in the folder name.
2. As example 1 but specify username (ian) and password (password)
ssrsexp /c:http://ian-xps:8080/ReportServer_S8R2 /r:/ /e:"c:\SSRS sales" /u:ian /p:"password"
3. As example 1 but export sub folders and overwrite any existing items
ssrsexp /c:http://ian-xps:8080/ReportServer_S8R2 /r:/ /e:"c:\SSRS sales" /s /o
4. As example 1 and export all items (reports, models, resources etc)
ssrsexp /c:http://ian-xps:8080/ReportServer_S8R2 /r:/ /e:"c:\SSRS sales" /i:a
5. As example 1 but export items reports and resources
ssrsexp /c:http://ian-xps:8080/ReportServer_S8R2 /r:/ /e:"c:\SSRS sales" /i:re
[i:<X>] Items to export
x=R Export reports
x=E Export resources
x=M Export model
x=D Export datasource
x=S Export dataset
x=P Export report part
6. As example 1 but export reports from /sales reports folder on SSRS Server
ssrsexp /c:http://ian-xps:8080/ReportServer_S8R2 /r:"/sales reports" /e:"c:\SSRS sales"
7. As example 1 but export to zip file c:\ssrsBackup.zip and add timestamp to file name
ssrsexp /c:http://ian-xps:8080/ReportServer_S8R2 /r:/ /z:"c:\SSRSBackup.zip /d
the /d adds the current time stamp in the format yyyy-mm-dd-hhmm.
yyyy = year
mm = month
dd = day
hh = hour (24 hour)
mm = minute
here is an example of /d added where the timestamp is 18th July 2012 23:31 added to backup.zip
backup_2012_07_18-2331.zip
8. As example 1 but export to both folder (c:\ssrs sales) and zip file c:\ssrsbackup.zip and also add timestamp to zip file.
ssrsexp /c:http://ian-xps:8080/ReportServer_S8R2 /r:/ /z:"c:\SSRSBackup.zip /d /e:"c:\SSRS sales"