--- title: "Use Custom Reports with Object Explorer Node Properties" ms.custom: seo-lt-2019 ms.date: "01/19/2017" ms.prod: sql ms.prod_service: "sql-tools" ms.reviewer: "" ms.technology: ssms ms.topic: conceptual helpviewer_keywords: - "SQL Server Management Studio [SQL Server], custom reports" ms.assetid: c7b84355-71ba-402d-85af-23826f18b7da author: "markingmyname" ms.author: "maghan" --- # Use Custom Reports with Object Explorer Node Properties [!INCLUDE[appliesto-ss-asdb-asdw-pdw-md](../../includes/appliesto-ss-asdb-asdw-pdw-md.md)] Custom reports can execute in the context of a selected Object Explorer node if the custom reports reference the report parameters of that node. This enables a custom report to use the current context, for example the current database, or a database or server object. ## Object Explorer Node Report Parameters |Parameter name|Data type| |------------------|-------------| |**ObjectName**|**String**| |**ObjectTypeName**|**String**| |**Filtered**|**Boolean**| |**ServerName**|**String**| |**FontName**|**String**| |**DatabaseName**|**String**| ## Object Explorer Node Report Parameters Example To run the example, use the following procedure. **To view the report parameter values for a node in Object Explorer** 1. Copy the following sample code into a new text file and name the file by using an .rdl extension. 2. Copy the report file to a folder that you have created on the database server for custom reports. 3. In [!INCLUDE[ssManStudio](../../includes/ssmanstudio-md.md)], right-click a node in Object Explorer, point to **Reports**, click Custom Reports. In the **Open File** dialog box, locate the custom reports folder and select the report file, and then click **Open**. When a new custom report is first opened from an Object Explorer node, the custom report is added to the most recently used list under **Custom Reports** on the shortcut menu of that node. When a standard report is opened for the first time, it will also appear on the most recently used list under **Custom Reports**. If a custom report file is deleted, the next time that the item is selected, a prompt will appear to delete the item from the most recently used list. 1. To change the number of files displayed on the recently used list, on the **Tools** menu, click **Options**, expand the **Environment** folder, and then click **General**. 2. Adjust the number for **Display files in recently used list**. ## Custom Report Code Sample The report that is created by using the following code will use the parameters that are associated with an Object Explorer node. ```
  
  
  
  
String  
true  
true  
ObjectName  
  
  
String  
true  
true  
ObjectTypeName  
  
  
Boolean  
true  
true  
Filtered  
  
  
String  
true  
true  
ServerName  
  
  
String  
  
  
Tahoma  
  
  
true  
FontName  
  
  
String  
true  
  
  
master  
  
  
true  
DatabaseName  
  
  
  
  
  
true  
Data Source=.  
SQL  
  
f1feee4c-0fdc-4301-9efa-3cd89eed2d9f  
  
  
1in  
1in  
true  
8.5in  
true  
  
  
  
textbox1  
1  
6in  
  
true  
0.36in  
AllReportParameters  
  
AllReportParameters0.36in
ObjectName 5 true =Parameters!ObjectName.Value ObjectTypeName 4 true =Parameters!ObjectTypeName.Value Filtered 3 true =Parameters!Filtered.Value ServerName 2 true =Parameters!ServerName.Value FontName 1 true =Parameters!FontName.Value DatabaseName true =Parameters!DatabaseName.Value 0.21in
textbox2 11 true ObjectName textbox3 10 true ObjectTypeName textbox4 9 true Filtered textbox5 8 true ServerName textbox6 7 true FontName textbox7 6 true DatabaseName 0.22in true
3in 1.5in 0.75in 1.125in 2in 1.375in
0.79in abb14e58-fd36-495a-89ff-b66f29ef287b 1in true SELECT 1 AllReportParameters System.String ObjectName System.String ObjectTypeName System.Boolean Filtered System.String ServerName System.String FontName System.String DatabaseName 6.875in 11in en-US 1in
``` ## See Also [Custom Reports in Management Studio](../../ssms/object/custom-reports-in-management-studio.md) [Add a Custom Report to Management Studio](../../ssms/object/add-a-custom-report-to-management-studio.md) [Unsuppress Run Custom Report Warnings](../../ssms/object/unsuppress-run-custom-report-warnings.md)