diff --git a/samples/features/r-services/SSMS Custom Reports/R Services - Active Sessions.rdl b/samples/features/r-services/SSMS Custom Reports/R Services - Active Sessions.rdl
new file mode 100644
index 00000000..be6f489d
--- /dev/null
+++ b/samples/features/r-services/SSMS Custom Reports/R Services - Active Sessions.rdl
@@ -0,0 +1,1588 @@
+
+
+ 0
+
+
+
+ SQL
+ Data Source=.
+ true
+
+ Integrated
+ f68705bb-df33-493e-b2ea-e8070ba8d88b
+
+
+
+
+
+ SqlConnection
+ select r.session_id, r.blocking_session_id, r.status
+ , db_name(s.database_id) as database_name, s.login_name
+ , r.wait_time, r.wait_type, r.last_wait_type
+ , r.total_elapsed_time, r.reads, r.logical_reads, r.writes
+ , er.language as script_type, er.degree_of_parallelism, er.external_user_name
+ from sys.dm_exec_requests as r
+ join sys.dm_external_script_requests as er
+ on r.external_script_request_id = er.external_script_request_id
+ join sys.dm_exec_sessions as s
+ on s.session_id = r.session_id;
+ true
+
+
+
+ session_id
+ System.Int16
+
+
+ blocking_session_id
+ System.Int16
+
+
+ status
+ System.String
+
+
+ wait_type
+ System.String
+
+
+ database_name
+ System.String
+
+
+ login_name
+ System.String
+
+
+ wait_time
+ System.Int32
+
+
+ last_wait_type
+ System.String
+
+
+ total_elapsed_time
+ System.Int32
+
+
+ reads
+ System.Int64
+
+
+ writes
+ System.Int64
+
+
+ logical_reads
+ System.Int64
+
+
+ script_type
+ System.String
+
+
+ degree_of_parallelism
+ System.Int32
+
+
+ external_user_name
+ System.String
+
+
+
+
+
+
+
+
+
+
+
+
+ 1in
+
+
+ 1in
+
+
+ 0.63333in
+
+
+ 1in
+
+
+
+
+ 0.25in
+
+
+
+
+ true
+ true
+
+
+
+
+ Total Elapsed Time (ms)
+
+
+
+
+
+
+ Textbox4
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Reads
+
+
+
+
+
+
+ Textbox5
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Logical Reads
+
+
+
+
+
+
+ Textbox29
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Writes
+
+
+
+
+
+
+ Textbox7
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.25in
+
+
+
+
+ true
+ true
+
+
+
+
+ =Sum(Fields!total_elapsed_time.Value)
+
+
+
+
+
+
+ total_elapsed_time
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Sum(Fields!reads.Value)
+
+
+
+
+
+
+ reads
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Sum(Fields!logical_reads.Value)
+
+
+
+
+
+
+ reads
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Sum(Fields!writes.Value)
+
+
+
+
+
+
+ writes
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ Session ID
+
+
+
+
+
+
+ Textbox23
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ Blocking Session ID
+
+
+
+
+
+
+ Textbox21
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ Status
+
+
+
+
+
+
+ Textbox19
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ Wait Type
+
+
+
+
+
+
+ Textbox17
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ Wait Time
+
+
+
+
+
+
+ Textbox27
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ Last Wait Type
+
+
+
+
+
+
+ Textbox15
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.525in
+
+
+ true
+ true
+
+
+
+
+ Script Type
+
+
+
+
+
+
+ Textbox13
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.475in
+
+
+ true
+ true
+
+
+
+
+ DOP
+
+
+
+
+
+
+ Textbox11
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ Database Name
+
+
+
+
+
+
+ Textbox10
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ Login Name
+
+
+
+
+
+
+ Textbox2
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1.34167in
+
+
+ true
+ true
+
+
+
+
+ External User Name
+
+
+
+
+
+
+ Textbox9
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ =Fields!session_id.Value
+
+
+
+
+ =Fields!session_id.Value
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ =Fields!session_id.Value
+
+
+
+
+
+
+ session_id
+
+
+ #9eb6e4
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+ =Fields!blocking_session_id.Value
+
+
+
+
+ =Fields!blocking_session_id.Value
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ =Fields!blocking_session_id.Value
+
+
+
+
+
+
+ blocking_session_id
+
+
+ #c6daf8
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+ =Fields!status.Value
+
+
+
+
+ =Fields!status.Value
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ =Fields!status.Value
+
+
+
+
+
+
+ status
+
+
+ #e6eefc
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+ =Fields!wait_type.Value
+
+
+
+
+ =Fields!wait_type.Value
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ =Fields!wait_type.Value
+
+
+
+
+
+
+ wait_type
+
+
+ #e6eefc
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ =Fields!wait_time.Value
+
+
+
+
+
+
+ wait_time
+
+
+ #e6eefc
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+ =Fields!last_wait_type.Value
+
+
+
+
+ =Fields!last_wait_type.Value
+
+
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ =Fields!last_wait_type.Value
+
+
+
+
+
+
+ last_wait_type
+
+
+ #e6eefc
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+ =Fields!script_type.Value
+
+
+
+
+ =Fields!script_type.Value
+
+
+
+ 0.525in
+
+
+ true
+ true
+
+
+
+
+ =Fields!script_type.Value
+
+
+
+
+
+
+ script_type
+
+
+ #e6eefc
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+ =Fields!degree_of_parallelism.Value
+
+
+
+
+ =Fields!degree_of_parallelism.Value
+
+
+
+ 0.475in
+
+
+ true
+ true
+
+
+
+
+ =Fields!degree_of_parallelism.Value
+
+
+
+
+
+
+ degree_of_parallelism
+
+
+ #e6eefc
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ =Fields!database_name.Value
+
+
+
+
+
+
+ database_name
+
+
+ #e6eefc
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+
+
+ true
+ true
+
+
+
+
+ =Fields!login_name.Value
+
+
+
+
+
+
+ login_name
+
+
+ #e6eefc
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+ =Fields!external_user_name.Value
+
+
+
+
+ =Fields!external_user_name.Value
+
+
+
+ 1.34167in
+
+
+ true
+ true
+
+
+
+
+ =Fields!external_user_name.Value
+
+
+
+
+
+
+ external_user_name
+
+
+ #e6eefc
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ external_script_requests
+ 1.10833in
+ 0.5in
+ 13.975in
+
+
+
+
+
+ true
+ true
+
+
+
+
+ SQL Server R Services - Active Sessions
+
+
+
+
+
+
+ Title
+ ReportTitle
+ 0.4in
+ 6in
+ 1
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ This report shows the currently executing R scripts on the server.
+
+
+
+
+
+
+ Textbox1
+ 0.46944in
+ 0.25in
+ 9in
+ 2
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ View SQL script
+
+
+
+
+
+
+
+
+
+
+ =".\R Services - Script"
+
+
+ SQL Server R Services - Active Sessions
+
+
+ =DataSets("external_script_requests").CommandText
+
+
+
+
+
+
+ 0.78889in
+ 12.91667in
+ 0.25in
+ 1.05833in
+ 3
+ Click here to view the T-SQL script used to generate the data in the report.
+
+
+ LightGrey
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ 1.64667in
+
+
+
+
+ 13.975in
+
+
+ 0.45in
+ true
+ true
+
+
+ true
+ true
+
+
+
+
+ =Globals!ExecutionTime
+
+
+
+
+
+
+ ExecutionTime
+ 0.2in
+ 9.975in
+ 0.25in
+ 2in
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+ 1in
+ 1in
+ 1in
+
+
+
+
+
+
+ String
+
+
+ SPE-SAG4HP-02
+
+
+ ServerName
+ true
+
+
+ Inch
+ 2d6f122f-88fc-4fb4-9573-33bf83616a77
+
\ No newline at end of file
diff --git a/samples/features/r-services/SSMS Custom Reports/R Services - Configuration.rdl b/samples/features/r-services/SSMS Custom Reports/R Services - Configuration.rdl
new file mode 100644
index 00000000..32d8484a
--- /dev/null
+++ b/samples/features/r-services/SSMS Custom Reports/R Services - Configuration.rdl
@@ -0,0 +1,969 @@
+
+
+ This report provides SQL Server R Services configuration information
+ Umachandar Jayachandran
+ 0
+
+
+
+ SQL
+ Data Source=.
+ true
+
+ Integrated
+ b3217cf0-c85a-4901-908f-abd9144894c6
+
+
+
+
+
+ SqlConnection
+ /*
+ Retrieve the R Services installation setting & configuration options:
+ Implied Authentication Configuration is checked by verifying if login exists for SQLRUserGroup
+*/
+select CAST(SERVERPROPERTY('IsAdvancedAnalyticsInstalled') as int) as IsRServicesInstalled
+ , CAST(value_in_use as int) as ExternalScriptsEnabled
+ , COALESCE(SIGN(SUSER_ID(CONCAT(CAST(SERVERPROPERTY('MachineName') as nvarchar(128))
+ , '\SQLRUserGroup'
+ , CAST(serverproperty('InstanceName') as nvarchar(128)
+ )))), 0) as ImpliedAuthenticationEnabled
+ from sys.configurations
+ where name = 'external scripts enabled';
+ true
+
+
+
+ IsRServicesInstalled
+ System.Int32
+
+
+ ExternalScriptsEnabled
+ System.Int32
+
+
+ ImpliedAuthenticationEnabled
+ System.Int32
+
+
+
+
+
+ SqlConnection
+ /*
+ Get R runtime properties
+*/
+exec sp_execute_external_script
+ @language = N'R'
+ , @script = N'
+# Retrieve properties like R.home, libPath & default packages
+OutputDataSet <- data.frame(
+ property_name = c("R.home", "libPaths", "defaultPackages"),
+ property_value = c(R.home(), .libPaths(), paste(getOption("defaultPackages"), collapse=", "))
+)
+# Transform R version properties to data.frame
+OutputDataSet <- rbind(OutputDataSet, data.frame(
+ property_name = names(R.version),
+ property_value = matrix(unlist(R.version), nrow = length(R.version), byrow = TRUE),
+ stringsAsFactors = FALSE)
+)
+'
+with result sets ((property_name nvarchar(100), property_value nvarchar(4000)));
+ true
+
+
+
+ property_name
+ System.String
+
+
+ property_value
+ System.String
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.4875in
+
+
+ 6.49583in
+
+
+
+
+ 0.25in
+
+
+
+
+ true
+ true
+
+
+
+
+ R Runtime Property
+
+
+
+
+
+
+ Textbox8
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Property Value
+
+
+
+
+
+
+ Textbox9
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.25in
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!property_name.Value
+
+
+
+
+
+
+ property_name
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!property_value.Value
+
+
+
+
+
+
+ property_value
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ After
+
+
+
+
+
+
+ R_Properties
+ 1.65833in
+ 0.5in
+ 7.98333in
+
+
+
+
+
+
+
+
+ 1in
+
+
+ 1in
+
+
+ 1.25833in
+
+
+
+
+ 0.25in
+
+
+
+
+ true
+ true
+
+
+
+
+ R Services Installed
+
+
+
+
+
+
+ Textbox2
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ External Scripts Enabled
+
+
+
+
+
+
+ Textbox3
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Implied Authentication Enabled
+
+
+
+
+
+
+ Textbox5
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.25in
+
+
+
+
+
+
+
+ =First(Fields!IsRServicesInstalled.Value)
+ 1
+ NoOutput
+
+ None
+ Tablix1
+
+ NaN
+ 1
+
+
+ NaN
+ 1
+
+ None
+
+ External
+
+
+ 1
+
+
+
+ 0
+ 1
+
+
+ 0
+ 1
+
+ Red
+ 1
+ ThreeSymbolCross
+
+ External
+
+
+
+
+
+ 1
+ 1
+
+
+ 1
+ 1
+
+ Green
+ 1
+ ThreeSymbolCheck
+
+ External
+
+
+
+
+ 0
+
+ ThreeCircledSymbols
+
+ 4
+ 4
+ 92
+ 92
+
+
+ true
+
+
+
+ Gainsboro
+ DiagonalLeft
+ Gray
+ None
+ 0pt
+
+
+
+
+
+ External
+
+
+
+
+ External
+
+
+ Feature_Settings
+
+
+ White
+
+
+
+
+
+
+
+
+
+
+ =Sum(Fields!ExternalScriptsEnabled.Value)
+ 1
+ NoOutput
+
+ None
+ Tablix1
+
+ NaN
+ 1
+
+
+ NaN
+ 1
+
+ None
+
+ External
+
+
+ 1
+
+
+
+ 0
+ 1
+
+
+ 0
+ 1
+
+ Red
+ 1
+ ThreeSymbolCross
+
+ External
+
+
+
+
+
+ 1
+ 1
+
+
+ 1
+ 1
+
+ Green
+ 1
+ ThreeSymbolCheck
+
+ External
+
+
+
+
+ 0
+
+ ThreeCircledSymbols
+
+ 4
+ 4
+ 92
+ 92
+
+
+ true
+
+
+
+ Gainsboro
+ DiagonalLeft
+ Gray
+ None
+ 0pt
+
+
+
+
+
+ External
+
+
+
+
+ External
+
+
+ Feature_Settings
+
+
+ White
+
+
+
+
+
+
+
+
+
+
+ =Sum(Fields!ImpliedAuthenticationEnabled.Value)
+ 1
+ NoOutput
+
+ None
+ Tablix1
+
+ NaN
+ 1
+
+
+ NaN
+ 1
+
+ None
+
+ External
+
+
+ 1
+
+
+
+ 0
+ 1
+
+
+ 0
+ 1
+
+ Red
+ 1
+ ThreeSymbolCross
+
+ External
+
+
+
+
+
+ 1
+ 1
+
+
+ 1
+ 1
+
+ Green
+ 1
+ ThreeSymbolCheck
+
+ External
+
+
+
+
+ 0
+
+ ThreeCircledSymbols
+
+ 4
+ 4
+ 92
+ 92
+
+
+ true
+
+
+
+ Gainsboro
+ DiagonalLeft
+ Gray
+ None
+ 0pt
+
+
+
+
+
+ External
+
+
+
+
+ External
+
+
+ Feature_Settings
+
+
+ White
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Feature_Settings
+ 0.96944in
+ 0.5in
+ 3.25833in
+ 1
+
+
+
+
+
+ true
+ true
+
+
+
+
+ SQL Server R Services - Configuration
+
+
+
+
+
+
+ Title
+ ReportTitle
+ 0.4in
+ 7.98333in
+ 2
+
+
+ LightGrey
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ This report provides configuration settings for SQL Server R Services and properties of the R installation.
+
+
+
+
+
+
+ Textbox1
+ 0.51333in
+ 0.25in
+ 7.98333in
+ 3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ View SQL script
+
+
+
+
+
+
+
+
+
+
+ =".\R Services - Script"
+
+
+ SQL Server R Services - Configuration
+
+
+ =DataSets("Feature_Settings").CommandText & chr(13) & chr(10) & "go" & chr(13) & chr(10) & DataSets("R_Properties").CommandText
+
+
+
+
+
+
+ 0.96944in
+ 6.925in
+ 0.25in
+ 1.05833in
+ 4
+ Click here to view the T-SQL script used to generate the data in the report.
+
+
+ LightGrey
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ 2.15833in
+
+
+
+
+ 8.01667in
+
+
+ 0.45in
+ true
+ true
+
+
+ true
+ true
+
+
+
+
+ =Globals!ExecutionTime
+
+
+
+
+
+
+ ExecutionTime
+ 0.2in
+ 5.98333in
+ 0.25in
+ 2in
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+ 1in
+ 1in
+ 1in
+
+
+
+
+
+
+ String
+
+
+ .
+
+
+ ServerName
+ true
+
+
+ Inch
+ 9ab6c190-a62f-424e-a13a-102d103b4239
+
\ No newline at end of file
diff --git a/samples/features/r-services/SSMS Custom Reports/R Services - Packages.rdl b/samples/features/r-services/SSMS Custom Reports/R Services - Packages.rdl
new file mode 100644
index 00000000..87929fef
--- /dev/null
+++ b/samples/features/r-services/SSMS Custom Reports/R Services - Packages.rdl
@@ -0,0 +1,730 @@
+
+
+ This report shows R packages installed on the SQL Server machine.
+ Umachandar Jayachandran
+ 0
+
+
+
+ SQL
+ Data Source=.
+ true
+
+ Integrated
+ 888cc098-f33d-44a7-9758-c75f85be1817
+
+
+
+
+
+ SqlConnection
+ /*
+ Get list of installed packages:
+*/
+exec sp_execute_external_script
+ @language = N'R'
+ , @script = N'
+# Use installed packages to determine packages installed in the R directory
+OutputDataSet <- data.frame(installed.packages()[,c("Package", "Version", "Depends", "License", "Built", "LibPath")]);
+ '
+with result sets ((Package nvarchar(255), Version nvarchar(100), Depends nvarchar(4000), License nvarchar(1000), Built nvarchar(100), LibPath nvarchar(2000)));
+ true
+
+
+
+ Package
+ System.String
+
+
+ Version
+ System.String
+
+
+ Depends
+ System.String
+
+
+ License
+ System.String
+
+
+ Built
+ System.String
+
+
+ LibPath
+ System.String
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.33056in
+
+
+ 0.84723in
+
+
+ 2.18331in
+
+
+ 1.725in
+
+
+ 0.53334in
+
+
+ 3.78891in
+
+
+
+
+ 0.25in
+
+
+
+
+ true
+ true
+
+
+
+
+ Package
+
+
+
+
+
+
+ Textbox2
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Version
+
+
+
+
+
+
+ Textbox3
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Depends
+
+
+
+
+
+
+ Textbox5
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ License
+
+
+
+
+
+
+ Textbox7
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Built
+
+
+
+
+
+
+ Textbox9
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Lib Path
+
+
+
+
+
+
+ Textbox11
+
+
+ #4c68a2
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.25in
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Package.Value
+
+
+
+
+
+
+ Package
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Version.Value
+
+
+
+
+
+
+ Version
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Depends.Value
+
+
+
+
+
+
+ Depends
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!License.Value
+
+
+
+
+
+
+ License
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Built.Value
+
+
+
+
+
+
+ Built
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!LibPath.Value
+
+
+
+
+
+
+ LibPath
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ After
+
+
+
+
+
+
+ R_Packages
+ 1.15in
+ 0.5in
+ 10.40835in
+
+
+
+
+
+ true
+ true
+
+
+
+
+ SQL Server R Services - Installed Packages
+
+
+
+
+
+
+ Title
+ ReportTitle
+ 0.4in
+ 10.40835in
+ 1
+
+
+ LightGrey
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ This report displays few properties of the packages installed in the R_SERVICES directory of the SQL Server instance. Use this report to determine if a particular package is installed for use in SQL Server and the location of the package on the file system.
+
+
+
+
+
+
+ Textbox1
+ 0.42778in
+ 0.36667in
+ 10.40835in
+ 2
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ View SQL script
+
+
+
+
+
+
+
+
+
+
+ =".\R Services - Script"
+
+
+ SQL Server R Services - Installed Packages
+
+
+ =DataSets("R_Packages").CommandText
+
+
+
+
+
+
+ 0.825in
+ 9.35002in
+ 0.25in
+ 1.05833in
+ 3
+ Click here to view the T-SQL script used to generate the data in the report.
+
+
+ LightGrey
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ 1.68333in
+
+
+
+
+ 10.43335in
+
+
+ 0.45in
+ true
+ true
+
+
+ true
+ true
+
+
+
+
+ =Globals!ExecutionTime
+
+
+
+
+
+
+ ExecutionTime
+ 0.2in
+ 8.40835in
+ 0.25in
+ 2in
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+ 1in
+ 1in
+ 1in
+
+
+
+
+
+
+ String
+
+
+ .
+
+
+ ServerName
+ true
+
+
+ Inch
+ 753a9ad3-917c-4031-85df-7d90218a26d3
+
\ No newline at end of file
diff --git a/samples/features/r-services/SSMS Custom Reports/R Services - Resource Usage.rdl b/samples/features/r-services/SSMS Custom Reports/R Services - Resource Usage.rdl
new file mode 100644
index 00000000..338d86c9
--- /dev/null
+++ b/samples/features/r-services/SSMS Custom Reports/R Services - Resource Usage.rdl
@@ -0,0 +1,1970 @@
+
+
+ This report shows resource usage of R Services.
+ Umachandar Jayachandran
+ 0
+
+
+
+ SQL
+ Data Source=.
+ true
+
+ Integrated
+ f68705bb-df33-493e-b2ea-e8070ba8d88b
+
+
+
+
+
+ SqlConnection
+ /*
+ Retrieve OS memory, SQL memory (current usage) & R Processes memory (peak)
+*/
+select physical_memory_kb
+ , committed_kb
+ , (select sum(peak_memory_kb)
+ from sys.dm_resource_governor_external_resource_pools as ep
+ ) as external_pool_peak_memory_kb
+ from sys.dm_os_sys_info;
+
+
+
+ physical_memory_kb
+ System.Int64
+
+
+ committed_kb
+ System.Int64
+
+
+ external_pool_peak_memory_kb
+ System.Int64
+
+
+
+
+
+ SqlConnection
+ /*
+ Get SQL resource pool & external resource pool statistics:
+*/
+select concat('SQL Server - ', p.name) as pool_name, p.total_cpu_usage_ms/60./60. as total_cpu_usage_hours, p.read_io_completed_total, p.write_io_completed_total
+ from sys.dm_resource_governor_resource_pools as p
+ union all
+select concat('External Pool - ', ep.name) as pool_name, ep.total_cpu_user_ms/60./60., ep.read_io_count, ep.write_io_count
+ from sys.dm_resource_governor_external_resource_pools as ep;
+ true
+
+
+
+ pool_name
+ System.String
+
+
+ total_cpu_usage_hours
+ System.Decimal
+
+
+ read_io_completed_total
+ System.Int64
+
+
+ write_io_completed_total
+ System.Int64
+
+
+
+
+
+ SqlConnection
+ /*
+ Retrieve memory configuration of SQL Server & External Resource Pools.
+ If SQL Sever is running with default then max_memory limit is considered as 100% of OS memory
+*/
+select 'SQL Server' as name
+ , case cast(c.value as bigint) when 2147483647 then 100 else (select physical_memory_kb from sys.dm_os_sys_info)/cast(c.value as bigint) end as max_memory_percent
+ from sys.configurations as c
+ where c.name like 'max server memory (MB)'
+ union all
+select concat('External Pool - ', ep.name) as pool_name, ep.max_memory_percent
+ from sys.dm_resource_governor_external_resource_pools as ep;
+ true
+
+
+
+ name
+ System.String
+
+
+ max_memory_percent
+ System.Int64
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ =Fields!pool_name.Value
+
+
+
+
+ =Fields!pool_name.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ =Sum(Fields!total_cpu_usage_hours.Value)
+
+
+
+
+ #VALY
+
+
+
+
+ Output
+
+
+ Bar
+
+
+
+
+
+
+
+
+
+
+ Primary
+ Primary
+
+ Black
+ 0pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ NaN
+ NaN
+
+
+
+
+
+
+
+ Axis Title
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ Opposite
+ NaN
+ NaN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ NaN
+ NaN
+
+
+
+
+
+
+
+ Axis Title
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ Opposite
+ NaN
+ NaN
+
+
+
+
+
+
+
+
+
+
+ CPU Usage (Hours)
+
+
+
+ BrightPastel
+
+ #4c68a2
+ #b5dddf
+ #7292cc
+ #89bcc5
+ #c4d5f3
+ #c6c595
+ #87acf3
+ #7b9291
+ #a8c4ec
+ #a49ed4
+
+
+ Emboss
+
+
+
+ No Data Available
+
+
+ pool_statistics
+ 4.43055in
+ 2.93056in
+ 4.25in
+
+ 2pt
+
+ #c6daf8
+ TopBottom
+ #e6eefc
+
+
+
+
+
+
+
+
+ =Fields!name.Value
+
+
+
+
+ =Fields!name.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ =Sum(Fields!max_memory_percent.Value)
+
+
+
+
+ #VALY
+
+
+
+
+ Output
+
+
+ Bar
+ Stacked
+
+
+
+
+
+
+
+
+
+
+
+ Max Percent
+
+ Primary
+ Primary
+
+ Black
+ 0pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ NaN
+ NaN
+
+
+
+
+
+
+
+ Axis Title
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ Opposite
+ NaN
+ NaN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ NaN
+ NaN
+
+
+
+
+
+
+
+ Axis Title
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ Opposite
+ NaN
+ NaN
+
+
+
+
+
+
+
+
+
+
+ Max Memory Setting (%)
+
+
+
+ BrightPastel
+
+ #4c68a2
+ #b5dddf
+ #7292cc
+ #89bcc5
+ #c4d5f3
+ #c6c595
+ #87acf3
+ #7b9291
+ #a8c4ec
+ #a49ed4
+
+
+ Emboss
+
+
+
+ No Data Available
+
+
+ memory_limits
+ 1.31944in
+ 4.31944in
+ 3in
+ 4.9in
+ 1
+
+ 2pt
+
+ #c6daf8
+ TopBottom
+ #e6eefc
+
+
+
+
+
+
+
+
+ =Fields!pool_name.Value
+
+
+
+
+ =Fields!pool_name.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ =Sum(Fields!read_io_completed_total.Value)
+
+
+
+
+ #VALY
+
+
+
+
+ Output
+
+
+ Bar
+
+
+
+
+
+
+
+
+
+
+
+ Reads
+
+ Primary
+ Primary
+
+ Black
+ 0pt
+
+
+
+
+
+
+ =Sum(Fields!write_io_completed_total.Value)
+
+
+
+
+ #VALY
+
+
+
+
+ Output
+
+
+ Bar
+
+
+
+
+
+
+
+
+
+
+
+ Writes
+
+ Primary
+ Primary
+
+ Black
+ 0pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ NaN
+ NaN
+
+
+
+
+
+
+
+ Axis Title
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ Opposite
+ NaN
+ NaN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ NaN
+ NaN
+
+
+
+
+
+
+
+ Axis Title
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ Opposite
+ NaN
+ NaN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Black
+ Black
+
+
+
+
+ IO Statistics (Count)
+
+
+
+ BrightPastel
+
+ #4c68a2
+ #b5dddf
+ #7292cc
+ #89bcc5
+ #c4d5f3
+ #c6c595
+ #87acf3
+ #7b9291
+ #a8c4ec
+ #a49ed4
+
+
+ Emboss
+
+
+
+ No Data Available
+
+
+ pool_statistics
+ 4.43055in
+ 4.31944in
+ 3in
+ 4.9in
+ 2
+
+ 2pt
+
+ #c6daf8
+ TopBottom
+ #e6eefc
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ =Sum(Fields!physical_memory_kb.Value)
+
+
+
+ true
+
+ #VALY
+
+
+
+
+ Output
+
+ = "OS (" & Round(Fields!physical_memory_kb.Value/1024) & " MB)"
+
+
+
+ Shape
+ ExplodedPie
+
+
+
+
+
+
+
+
+
+
+ Primary
+ Primary
+
+ Black
+ 0pt
+
+
+
+
+
+
+ =Sum(Fields!committed_kb.Value)
+
+
+
+ true
+
+ #VALY
+
+
+
+
+ Output
+
+ = "SQL Server (" & Round(Fields!committed_kb.Value/1024) & " MB)"
+
+
+
+ Shape
+
+
+
+
+
+
+
+
+
+
+
+
+ PieDrawingStyle
+ Concave
+
+
+ Primary
+ Primary
+
+ Black
+ 0pt
+
+
+
+
+
+
+
+
+
+
+ Axis Title
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ NaN
+ NaN
+
+
+
+
+
+
+
+ Axis Title
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ Opposite
+ NaN
+ NaN
+
+
+
+
+
+
+
+
+
+ Axis Title
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ NaN
+ NaN
+
+
+
+
+
+
+
+ Axis Title
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5
+
+ NaN
+ Opposite
+ NaN
+ NaN
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+ Black
+ Black
+
+
+
+
+ Current Memory Consumption
+
+
+
+ BrightPastel
+
+ #4c68a2
+ #b5dddf
+ #7292cc
+ #89bcc5
+ #c4d5f3
+ #c6c595
+ #87acf3
+ #7b9291
+ #a8c4ec
+ #a49ed4
+
+
+ Emboss
+
+
+
+ No Data Available
+
+
+ sql_memory_usage
+ 1.31944in
+ 3in
+ 4.25in
+ 3
+
+ 2pt
+
+ #c6daf8
+ TopBottom
+ #e6eefc
+
+
+
+ true
+ true
+
+
+
+
+ SQL Server R Services - Resource Usage
+
+
+
+
+
+
+ Title
+ ReportTitle
+ 0.4in
+ 7.98333in
+ 4
+
+
+ LightGrey
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+ 1.65833in
+
+
+
+
+ 0.25in
+
+
+
+
+ true
+ true
+
+
+
+
+ =Round(Sum(Fields!external_pool_peak_memory_kb.Value, "sql_memory_usage")/1024) & " MB"
+
+
+
+
+
+
+ peak_memory_kb
+
+
+ LightGrey
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ sql_memory_usage
+ 1in
+ 2.43333in
+ 0.25in
+ 1.65833in
+ 5
+
+
+
+
+
+ true
+ true
+
+
+
+
+ R Scripts - Peak Memory Usage:
+
+
+
+
+
+
+ Textbox3
+ 0.98833in
+ 0.08in
+ 0.25in
+ 2.28389in
+ 6
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ This report provides detailed data on the resource consumption of R Services with respect to SQL Server. Use this report to adjust external resource pool setting for R scripts.
+
+
+
+
+
+
+ Textbox1
+ 0.46944in
+ 0.375in
+ 7.98333in
+ 7
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ View SQL script
+
+
+
+
+
+
+
+
+
+
+ =".\R Services - Script"
+
+
+ SQL Server R Services - Resource Usage
+
+
+ =DataSets("sql_memory_usage").CommandText & chr(13) & chr(10) & "go" & chr(13) & chr(10) & DataSets("memory_limits").CommandText & chr(13) & chr(10) & "go" & chr(13) & chr(10) & DataSets("pool_statistics").CommandText
+
+
+
+
+
+
+ 0.98833in
+ 8.075in
+ 0.25in
+ 1.05833in
+ 8
+ Click here to view the T-SQL script used to generate the data in the report.
+
+
+ LightGrey
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ 7.55555in
+
+
+
+
+ 9.275in
+
+
+ 0.45in
+ true
+ true
+
+
+ true
+ true
+
+
+
+
+ =Globals!ExecutionTime
+
+
+
+
+
+
+ ExecutionTime
+ 0.2in
+ 7.13333in
+ 0.25in
+ 2in
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+ 1in
+ 1in
+ 1in
+
+
+
+
+
+
+ String
+
+
+ .
+
+
+ ServerName
+ true
+
+
+ Inch
+ 2d6f122f-88fc-4fb4-9573-33bf83616a77
+
\ No newline at end of file
diff --git a/samples/features/r-services/SSMS Custom Reports/R Services - Script.rdl b/samples/features/r-services/SSMS Custom Reports/R Services - Script.rdl
new file mode 100644
index 00000000..6646dd22
--- /dev/null
+++ b/samples/features/r-services/SSMS Custom Reports/R Services - Script.rdl
@@ -0,0 +1,245 @@
+
+
+ 0
+
+
+
+ SQL
+ Data Source=.
+ true
+
+ Integrated
+ f68705bb-df33-493e-b2ea-e8070ba8d88b
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ SQL Server R Services - T-SQL Script
+
+
+
+
+
+
+ Title
+ ReportTitle
+ 0.4in
+ 6in
+
+
+ LightGrey
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ This is the T-SQL script for generating the data in report:
+
+
+
+
+
+
+ Textbox1
+ 0.46944in
+ 0.03in
+ 0.25in
+ 3.50333in
+ 1
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!SQLR_Script.Value
+
+
+
+
+
+
+ 0.80556in
+ 0.03in
+ 0.25in
+ 8.95333in
+ 2
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!SQLR_ReportName.Value
+
+
+
+
+
+
+ Textbox1
+ 0.46944in
+ 3.56111in
+ 0.25in
+ 5.42222in
+ 3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ 1.125in
+
+
+
+
+ 9.01667in
+
+
+ 0.45in
+ true
+ true
+
+
+ true
+ true
+
+
+
+
+ =Globals!ExecutionTime
+
+
+
+
+
+
+ ExecutionTime
+ 0.2in
+ 6.98333in
+ 0.25in
+ 2in
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 1in
+ 1in
+ 1in
+ 1in
+
+
+
+
+
+
+ String
+
+
+ .
+
+
+ ServerName
+ true
+
+
+ String
+
+
+ No Report
+
+
+ true
+ SQLR_ReportName
+ true
+
+
+ String
+
+
+ -- SQL Script
+
+
+ SQLR_Script
+ true
+
+
+ Inch
+ 2d6f122f-88fc-4fb4-9573-33bf83616a77
+
\ No newline at end of file
diff --git a/samples/features/r-services/SSMS Custom Reports/README.txt b/samples/features/r-services/SSMS Custom Reports/README.txt
new file mode 100644
index 00000000..7a621262
--- /dev/null
+++ b/samples/features/r-services/SSMS Custom Reports/README.txt
@@ -0,0 +1,3 @@
+To use custom reports from SSMS, follow the instructions from below link:
+
+https://msdn.microsoft.com/en-us/library/bb153684.aspx