ActiveReports.Viewer3 Request technical support
Id Property
See Also  Example


Unique number associated with the tool.

Syntax

Visual Basic (Declaration) 
Public Property Id As Long
Visual Basic (Usage)Copy Code
Dim instance As Tool
Dim value As Long
 
instance.Id = value
 
value = instance.Id
C# 
public long Id {get; set;}

Example

C#Copy Code
// 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);
Visual BasicCopy Code
' 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)

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.

See Also