/* i-net software provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This programming example assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. i-net software support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. � i-net software 1998-2013 */ using System; using System.Collections.Generic; using Inet.Viewer.Data; using Inet.Viewer.WinForms; namespace Inet.Viewer { /// /// Event that is fired when the CurrentPage was changed /// /// /// public delegate void PageChanged(object sender, int page); /// /// Event that is fired when the data changes was changed. This can occur after a refesh or a restart of the server. /// /// /// public delegate void DataChanged(object sender, long timestamp); /// /// The mouse action mode that defines what should happen if the left mouse button was clicked within the displayed report /// public enum MouseMode { /// /// Click and drag causes panning of the page along with the mouse position /// movement. /// Panning = 0, /// /// Click and drag causes a text selection, line by line. /// SelectText = 1, /// /// ReportView.MODE_SNAPSHOT - Click and drag causes an image snapshot within a box at release of the mouse button. /// TakeSnapshot = 2 } /// /// This enum defines the different zoom modes /// public enum ZoomMode { /// /// To be able the set manual Zoom factor . No automatic zoom. /// Manual = 0, /// /// Automatically zoom in or out so that the full width of the page is visible. /// PageWidth = 1, /// /// Automatically zoom in or out so that the full height of the page is visible. /// PageHeight = 2, /// /// Automatically zoom in or out so that the full page is visible. This /// is equivalent to PageHeight when the page is a portrait view, or to PageWidth /// when the page is a landscape view. /// FullPage = 3 } /// /// ViewMode to distinguis the different Page View Modes /// public enum PageViewMode { /// /// Only one page is shown at a time. /// SinglePage = 1, /// /// The report can be scrolled through in its entirety, with each page being shown above the next. /// SingleContinuous = 2, /// /// Only two pages are shown at a time, one next to the other. /// DoublePage = 3, /// /// The report can be scrolled through in its entirety, however showing the pages two by two. /// DoubleContinuous = 4 } /// /// Used to distinguish the different Loading Status /// public enum Status { /// /// The report view is loading for the first time, no pages have been loaded yet. /// Initialized = 0, /// /// At least one page has been loaded and the report view is currently fetching /// the other pages of the report if there are any /// Loading = 1, /// /// The report has been successfully loaded /// Finished = 2, /// /// The loading has been canceled by the user /// Canceled = -1 } /// /// The ReportView is the top-level instance for a report, it holds references to the report's /// NavigationView and StatusBar. It offers various navigation methods, as well as the possibility to /// extract components and replace them with own components.
/// To obtain an instance of a ReportView, use the methods
///
public interface IReportView { /// /// Displays an error box showing the Throwable's error message. If a ViewerException is thrown, the special messages and properties /// of the ViewerException are shown. Otherwise, only the getMessage() as well as the stack trace are shown. /// /// Throwable to display in an error box. Best if this Throwable is a ViewerException. void ShowError(Exception th); /// /// Causes this ReportView to refresh its pages by re-fetching the report data - this causes a /// re-rendering of the report data. If "promptOnRefresh" is set, this will cause the prompts /// to be fetched again as well. void DataRefresh(); /// /// Causes the page indicated by the parameter pageNum to be displayed in this ReportView. If /// this page does not exist in the report, calling this method will do nothing at all. Note this /// is an asynchronous call - the page will be displayed at some point, but it is not guaranteed /// that the page is actually visible as soon as this method returns. /// Number of page (starting at 1) to be displayed in this ReportView. /// /// Returns the number of the "current page" being displayed in this ReportView. If more than /// one PageView is visible, this returns the lowest page visible at this time. If no PageView /// is visible, this returns 0. /// Number of the first page currently visible in this ReportView, or 0 if no page is /// visible. /// int CurrentPage { get; set; } /// /// Returns the total number of pages this report has. If the total number of pages is as of /// yet unknown (for example if the report is still being rendered), this will return /// TOTAL_PAGE_COUNT_UNKNOWN. /// Total number of pages in the report, or TOTAL_PAGE_COUNT_UNKNOWN if still unknown. int PageCount { get; } /// /// Navigates one step back in the report - if this is not possible (e.g. the current page is /// already the first page of the report), this method does nothing. /// void PreviousPage(); /// /// Navigates one page forward in the report. If this is not possible e.g. the current page is /// already the last page of the report, this method does nothing. /// void NextPage(); /// /// Navigates directly to the last page in the report. If the current page is /// already the last page of the report, or if the total page count is not known /// as of yet (that is, the report is still being rendered), this method does nothing. Note this /// is an asynchronous call - the page will be displayed at some point, but it is not guaranteed /// that the page is actually visible as soon as this method returns. /// void LastPage(); /// /// Navigates directly to the first page of the report /// void FirstPage(); /// /// Sets the type of view this ReportView is to take and causes this view to be displayed /// immediately. /// /// Layout type to display in this ReportView. /// PageViewMode ViewMode { set; get; } /// /// Set and get the ReportInfo for this ReportView /// ReportInfo ReportInfo { get; set; } /// /// Returns the parent ReportViewer for this component. /// the parent ReportViewer for this component IReportViewer ReportViewer { get; set; } /// /// Sets the zoom factor to this value. Only values greater than 0 are allowed. This value is /// not a percentage value, that is, 2.0 is 2x view, 0.25 is 1/4 view, etc.
/// If the value is less than MIN_ZOOM_FACTOR, this has the same effect as calling setZoomFactor(MIN_ZOOM_FACTOR).
/// If the value is greater than MAX_ZOOM_FACTOR, this has the same effect as calling setZoomFactor(MAX_ZOOM_FACTOR).
/// If you want to zoom relative to the page's size, you have to set the accordingly. /// This Zoom Factor is used for the Manul Zoom Type, for the others this Property is ignored! ///
/// Factor to zoom with: 1.0 for 100%), 2.0 for 200%, etc. /// /// /// float ZoomFactor { set; get; } /// /// Defines the Minimum zoom level /// float ZoomMin { set; get; } /// /// Defines the Maximum zoom level /// float ZoomMax { set; get; } /// /// Sets the type of zoom to use in the report view when the ReportView is displayed anew (for /// example after resizing the display). Possible modes are manual zoom, a zoom to page with, zoom to page /// height, or zoom to show full page. /// /// Zoom type to use when displaying the ReportView. /// The different zoom modes ZoomMode ZoomMode { set; get; } /// /// Sets the mode for mouse actions in this ReportView, such as clicking and dragging. /// Enum with the different Modes /// Mouse mode to be used in the ReportView. /// MouseMode MouseActionMode { set; get; } /// /// Returns the ReportData object belonging to this ReportView. The ReportData object is the source of /// report data for this ReportView. If this is null, the ReportView has no connection to a ReportData /// source and should be considered obsolete. /// The ReportData object belonging to this ReportView IRenderData ReportData { get; set; } /// /// Returns the title of this report if it is known. If not known, the title returned will be null. /// The report title of this report if known. Will return null if not known /// string ReportTitle { get; set; } /// /// Returns whether this report view has more pages than the server page limit for a report allows for (causing the later pages to be truncated /// from the report). /// whether this report view has more pages than the server page limit bool PageLimitExceeded { get; } /// /// Returns whether this report was suppressed because it has no rows. /// true, if no rows. bool ReportSuppressed { get; } /// /// Determines if this ReportView can be closed via the User Interface, by for example clicking on the close button /// bool IsCloseable { get; set; } /// /// event for when the Page number changed /// event PageChanged PageChanged; /// /// Event when the Zoom changed /// event EventHandler ZoomChanged; /// /// Occured when data was initially received. /// event DataChanged DataInited; /// /// An event that is trigged when the data was updated, E.g. through the Refresh method /// event DataChanged DataChanged; /// /// Exports the report connected to this report view into the given file.
/// Export formats creating multiple files, e.g. HTML and SVG, creating a sub directory /// with the name of the first file. All files will be saved in that directory expecting the first file.
/// This method uses the default values for all parameters. ///
/// /// To export a report into a file without preview in the .Net Viewer we recommend /// to use the Engine directly instead of using the Viewer API because the .Net Viewer /// has to request the first report page in the .Net Viewer format before it can /// request the report in the specified export format. /// /// The export format in that the report will be exported. /// Name of the file in that the report will be exported. /// ExportProgress of running export /// If exporting has been disabled for this report or the requested export format is not available for this report /// /// With this export method a set of paramters can be set /// /// Progress Export(ExportFormat format, string file); /// /// Exports the report connected to this report view into the given file.
/// This method use the default value for all not specified paramters. For a complete list of report URL properties see the documentation.
/// URL Parameters ///
/// /// To export a report into a file without preview in the .Net Viewer we recommend /// to use the Engine directly instead of using the Viewer API because the .Net Viewer /// has to request the first report page in the .Net Viewer format before it can /// request the report in the specified export format. /// /// Properties for the export, including format, file and other properties if they are available for the selected format. /// ExportProgress of running export /// If exporting has been disabled for this report or the requested export format is not available for this report /// Simple method for export, just put in the format and the filename /// Progress Export(Dictionary exportParameter); /// /// Shows a print dialog and prints the report asynchronously. /// void Print(); /// /// Highlights a number of texts in the shown report. /// /// an array of instances saving the text block locations and substring ranges of the texts to hightlight void Highlight(SearchChunk[] searchChunk); /// /// Opens the export dialog for this report view. /// void OpenExportDialog(); /// /// Clears any hightlighted texts. /// void ClearSelection(); /// /// Focuses this control. /// void Focus(); } }