Defines a contract for actions that can be performed on report items.
'Declaration
Public Interface IAction
// Create an instance of Viewer
var viewer = new GrapeCity.ActiveReports.Viewer.Win.Viewer();
// Add an event handler for the Action event
viewer.Action += (sender, e) =>
{
switch (e.Action)
{
case (HyperlinkAction hyperlinkAction):
try
{
// Open the browser with the specified URL
Process.Start(new ProcessStartInfo
{
FileName = hyperlinkAction.Url,
UseShellExecute = true
});
}
catch (Exception ex)
{
Console.WriteLine("An error occurred: " + ex.Message);
}
finally
{
e.Cancel = true;
}
break;
case (DrillthroughAction drillthroughAction):
// Show dialog for DrillthroughAction
MessageBox.Show($"Drill through to: {drillthroughAction.TargetReport.LoadState}", "DrillThrough Action", MessageBoxButtons.OK);
break;
case (BookmarkAction bookmarkAction):
// Show dialog for BookmarkAction
MessageBox.Show($"Navigate to Bookmark: {bookmarkAction.TargetPage}", "Bookmark Action", MessageBoxButtons.OK);
break;
case (ApplyParametersAction applyParametersAction):
// Show dialog for ApplyParametersAction
var parameters = string.Join(", ", applyParametersAction.Parameters);
MessageBox.Show($"Apply Parameters: {parameters}", "ApplyParameters Action", MessageBoxButtons.OK);
break;
}
};
// Load a report with a hyperlink action and other actions
viewer.LoadDocument("report.rdlx");