ActiveReports 6 Online Help
Id Property
Example 

Unique number associated with the tool.
Syntax
'Declaration
 
Public Property Id As Long
public long Id {get; set;}
Remarks

Used to identify custom tools in the ToolClick events.  It is recommended that you assign a number greater than 5000 for your custom tools.

Note:  In order to enable the Viewer's Copy button, you will need to add references to the RtfExport.dll and the TextExport.dll.

If you add a tool to the viewer's toolbar and assign it an ID that already exists for a default tool, pushing the button will automatically open the default toolbar's dialog. For instance: if you removed the print button, added a custom button and set its ID to 2, when the button is pushed, it will show the print dialog.

Default tool IDs:

Toc = 0,
Print = 2,
Copy = 4,
Find = 6,
Single = 8,
Multiple = 9,
ZoomOut = 11,
ZoomIn = 12,
ZoomCombo = 13,
PrevPage = 15,
NextPage = 16,
PageEdit = 17,
BackwardHistory = 19,
ForwardHistory = 20

Note: If you change the Tool ID of an ActiveReports internal tool, you will also need to control the enabling and disabling of the tool.

Example
// Remove the default printer button
this.viewer1.Toolbar.Tools.RemoveAt(2);
// Create And add the custom button
DataDynamics.ActiveReports.Toolbar.Button btn = new DataDynamics.ActiveReports.Toolbar.Button();
btn.Caption = "MyPrint";
btn.ToolTip = "Custom Print Button";
btn.ImageIndex = 1;
btn.ButtonStyle = DataDynamics.ActiveReports.Toolbar.ButtonStyle.TextAndIcon;
btn.Id = 333;
this.viewer1.Toolbar.Tools.Insert(2,btn);
' Remove the default print button
Me.Viewer1.Toolbar.Tools.RemoveAt(2)
' Create and add the custom button
Dim btn As New DataDynamics.ActiveReports.Toolbar.Button()
btn.Caption = "MyPrint"
btn.ToolTip = "Custom Print Button"
btn.ImageIndex = 1
btn.ButtonStyle = DataDynamics.ActiveReports.Toolbar.ButtonStyle.TextAndIcon
btn.Id = 333
Me.Viewer1.Toolbar.Tools.Insert(2, btn)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Tool Class
Tool Members

Send Feedback