See Also

Tool Class  | Tool Members

Language

Visual Basic

C#

Show All

See Also Languages ActiveReports.Viewer Send feedback to Data Dynamics

Id Property

Unique number associated with the tool.

[Visual Basic]
Public Property Id As Long
[C#]
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

[C#] 

// 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 Basic] 

' 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)

See Also

Tool Class  | Tool Members

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.