HTML5 Viewer can be setup using the component properties which can be set on the ASPX page using C#/VB code. Below are samples of using the viewer properties.

 

Default.aspx

...

<cc1:StiWebViewer ID="StiWebViewer1" runat="server"

ShowPrintButton="false"

ScrollbarsMode="true"

ShowTooltips="false"

ShowExportToDbf="false"

ShowExportToDif="false"

Zoom="75"

Theme="Office2013WhiteTeal">

</cc1:StiWebViewer>

...

 

Default.aspx.cs

...

protected void Page_Load(object sender, EventArgs e)

{

StiWebViewer1.ShowPrintButton = false;

StiWebViewer1.ScrollbarsMode = true;

StiWebViewer1.ShowTooltips = false;

StiWebViewer1.ShowExportToDbf = false;

StiWebViewer1.ShowExportToDif = false;

StiWebViewer1.Zoom = 75;

StiWebViewer1.Theme = StiTheme.Office2013WhiteTeal;

StiWebViewer1.ReportDisplayMode = StiReportDisplayMode.Auto;

}

...

 

 

Please note that all dashboard elements have their own save options and full-screen buttons for preview. There are no special options to control displaying them, but they can be disabled through the properties of the element. The code below should be added after loading the report before passing it to the viewer.

 

Default.aspx.cs

...

var dbsElementInteraction = (report.GetComponentByName("RegionMap1") as Stimulsoft.Report.Dashboard.IStiElementInteraction).DashboardInteraction;

(dbsElementInteraction as Stimulsoft.Report.Dashboard.IStiInteractionLayout).ShowFullScreenButton = false;

(dbsElementInteraction as Stimulsoft.Report.Dashboard.IStiInteractionLayout).ShowSaveButton = false;

...

 

 

Basic settings

 

Name

Description

Width

Sets the width of the component in the required units that are specified in the Unit class. The value can be set in pixels - Unit.Pixel(), points - Unit.Point() and per cent - Unit.Percentage(). The default width is 100%.

Height

Sets the height of the component in the required units that are specified in the Unit class. The value can be set in pixels - Unit.Pixel(), points - Unit.Point() and per cent - Unit.Percentage(). By default, the automatic height is set depending on the size of the report page, or 650 pixels in the view mode of the viewer with scrollbars.

 

 

Work with server

 

Name

Description

RequestTimeout

Sets the time to wait for a response from the server in seconds, after which an error will be generated. The default value is 30 seconds. For big reports, it is recommended to increase this value.

CacheTimeout

Sets the time in minutes that the server will store the rendered report since the last action of the viewer. The default setting is 10 minutes.

CacheMode

Sets the report caching mode. It can take one of the following values of the StiServerCacheMode enumeration:

 

None – caching is disabled; the report will be reloaded each time using the OnGetReport event;

ObjectCache – the cache is used as the storage, the report is stored as an object (default value);

ObjectSession – the session is used as the storage, the report is stored as an object;

StringCache – the server cache is used as the storage, the report is serialized to a packed string;

StringSession – the session is used as a repository, the report is serialized into a packed string.

CacheItemPriority

Sets the priority of the report stored in the server cache. This property affects the automatic clearing of the server memory in case of a shortage. The lower the priority is, the greater is the chance of removing information from memory.

UseRelativeUrls

Sets the viewer mode in which relative references are used for AJAX requests to the server. By default, the property is set to true.

PortNumber

Gets or sets a value that specifies the port number to use in the URL. A value of 0 defines automatic detection (default value). A value of -1 removes the port number.

AllowAutoUpdateCache

Sets the mode for automatic cache update. The report stored in the cache or server session will be automatically re-saved after a certain period of time if the designer is idle (every 3 minutes). By default, the property is set to true.

PassQueryParametersForResources

Enables transferring of all parameters of the URL request when generating links to the resources of the viewer. If it is set to false, only the necessary parameters are used to query the resources of the viewer, which contributes to the correct work of the browser cache. By default, the property is set to true.

PassQueryParametersToReport

Enables using all the URL parameters of the request as the variable values. The variables' names must match the parameters. The default value of the property is false.

PassFormValues

Enables passing the values of the POST form to the client-side if these values are required to be used in the events of the viewer. When the property is enabled, the helper method - GetFormValues() - returns a collection of parameters of a form. By default, the property is set to false.

ShowServerErrorPage

Enables displaying an HTML page with the details of the error that occurred on the server-side. When the property is enabled, the details of the error will be displayed in the viewer window. If the property is disabled, only the numeric error code and a short error text in the dialog box will be displayed. By default, the property is set to true.

UseCompression

Enables compression of the viewer requests into the GZip stream. That allows to decrease the amount of internet traffic but slows down the viewer slightly. The default value of the property is false.

UseCacheForResources

Enables caching of the component resources on the server-side. The following resources are supported: scripts, styles, and images. This option improves the load speed of the component and also reduces the server load in multi-client environments. The default value is true.

UseLocalizedCache

Sets a value that enables the use of a different cache depending on the selected localization. The default value of the property is false.

 

 

Appearance

 

Name

Description

Theme

Specifies the theme of the viewers' layout. The list of available themes can be found in the StiTheme enumeration. The default value is Office2013.

CustomCss

Sets the path to the CSS file of the viewer's styles. The standard styles of the chosen theme will not be loaded if this property has got a value. The default value of the property is an empty string.

Localization

Specifies the path to the XML localization file. The path can be absolute or relative. By default, the English localization is used, which is built into the viewer and does not require additional XML files.

BackgroundColor

Sets the background color of the viewer. By default, it is set to White.

PageBorderColor

Sets the border color of the viewer. By default, it is set to Gray.

RightToLeft

Sets the Right to Left mode for viewer controls. By default, the property is set to false.

FullScreenMode

Sets the full-screen display mode of the viewer. By default, the property is set to false.

ScrollbarsMode

Sets the preview mode with scrollbars. By default, the property is set to false.

OpenLinksWindow

Sets the target window for opening links contained in the report. By default, it is set to Blank (new window).

OpenExportedReportWindow

Sets the target window for opening the export file from the viewer. By default, it is set to Blank (new window).

DesignWindow

Sets the target window for opening the report designer. By default, it is set to Self (current window).

ShowTooltips

Enables displaying tips for the viewer controls when the mouse hovers over. By default, the property is set to true.

ShowTooltipsHelp

Enables displaying links to online documentation for the viewer controls. By default, the property is set to true.

ShowDialogsHelp

Sets a value which indicates that show or hide the help button in dialogs. By default, the property is set to true.

PageAlignment

Sets the position of the report page in the viewer window. It can take one of the following values of the StiContentAlignment enumeration:

Left – the page will be aligned left;

Center – the page will be centered (default value);

Right – the page will be aligned right.

ShowPageShadow

Enables displaying shadow for report pages. By default, the property is set to true.

BookmarksPrint

Enables printing of report bookmarks (besides the report itself). By default, the property is set to false.

BookmarksTreeWidth

Sets the width of the bookmarks panel in pixels. By default, the width is 180 pixels.

ParametersPanelPosition

Specifies the position of the report parameters panel. It can take one of the following StiParametersPanelPosition enumeration values:

 

Top - the panel will be docked to the top margin (default value);

Left – the panel will be docked to the left margin.

ParametersPanelMaxHeight

Sets the maximum height of the parameters bar in pixels. By default, the maximum height is 300 pixels.

ParametersPanelColumnsCount

Sets the number of columns to display report parameters. By default, there are 2 columns.

ParametersPanelSortDataItems

Gets or sets a value which indicates that variable items will be sorted. By default, the property is set to true.

ParametersPanelDateFormat

Sets the date and time format for variables of the corresponding type in the parameters panel. By default, the date and time format set by the browser is used.

InterfaceType

Sets the type of interface used for the viewer. It can take one of the following StiInterfaceType enumeration values:

 

Auto – the viewer's interface is determined automatically depending of the device that is report is displayed on. That is the default value.

Mouse – the standard interface with a mouse control will be used for all the screen types.

Touch – the Touch interface will be used to control the viewer. The interface design was optimized for the 'touchscreen' display types. The viewer interface elements have been increased in size to simplify the control of the viewer and to improve its usability.

Mobile - the Mobile interface will be used to control the viewer for all the screen types. The Mobile interface was designed to control the viewer using the mobile smartphone display. This interface design was simplified and adapted to use with the smartphones.

AllowMobileMode

Enables or disables displaying a report or dashboard in the mobile mode. If the option is set to false, then the mobile view will not be used. If the option is set to true, the mobile view mode will be used when opening the viewer on mobile devices. By default, the option is set to true.

ChartRenderType

Sets the chart displaying mode on the report page. It can take one of the following StiChartRenderType enumeration values:

 

Image – charts are displayed as static images;

Vector – charts are displayed in the vector mode as an SVG object;

AnimatedVector - charts are displayed in the vector mode as an SVG object, the chart elements are displayed with animation (default value).

ReportDisplayMode

Sets the export mode for displaying report pages. It can take one of the following values of the StiReportDisplayMode enumeration:

 

FromReport - the export mode of the report elements is defined from report template settings - Div or Table;

Table – report elements are exported using HTML tables (default value);

Div – report elements are exported using DIV markup;

Span - report items are exported using SPAN markup.

DatePickerFirstDayOfWeek

Sets the first day of the week for the date picker. It can take one of the following values of the StiFirstDayOfWeek enumeration:

 

Monday – the first day of the week is Monday (default value);

Sunday – the first day of the week is Sunday.

DatePickerIncludeCurrentDayForRanges

Sets a value, which indicates that the current day will be included in the ranges of the date picker. By default, the property is set to false.

AllowTouchZoom

Sets ability to change the scale of the report page by using the two-fingers gesture (Pinch to Zoom) for the touch-screens. The default value of the property is true.

ShowReportIsNotSpecifiedMessage

Sets a value which indicates that 'The report is not specified' message will be shown. The default value of the property is true.

ImagesQuality

Gets or sets the image quality that will be used on the viewer page. It has the following values:

StiImagesQuality.Low - low quality, used to speed up loading reports and saves memory;

StiImagesQuality.Normal - normal quality, suitable for most cases (default value);

StiImagesQuality.High - high quality, used for ultra high-definition displays, but may slow down the loading of pages.

PrintToPdfMode

Sets the Print to PDF mode. It has the following values:

StiPrintToPdfMode.Hidden - hidden print mode (default value);

StiPrintToPdfMode.Popup - the PDF document will be displayed before printing in a pop-up window.

CombineReportPages

Sets a value which indicates that if a report contains several pages, then they will be combined in preview. By default, the property is set to false.

SaveMenuImageSize

Sets a value which indicates images size of the save menu in the viewer. The default value of the property is true.

 

 

Toolbar

 

Name

Description

ShowToolbar

Enables displaying the viewer toolbar. By default, the property is set to true.

ToolbarDisplayMode

Specifies the display mode of the toolbar of the viewer. It can take one of the following values of the StiToolbarDisplayMode enumeration values:

 

Simple - all controls are located on the same control panel (default value);

Separated - the control panel is split into top and bottom panels.

ToolbarBackgroundColor

Sets the color of the viewer toolbar. By default, color of the selected theme is used.

ToolbarBorderColor

Sets the color of the borders of the Viewer toolbar. By default, color of the selected theme is used.

ToolbarFontColor

Sets the text color for the toolbar and the viewer menu. By default, color of the selected theme is used.

ToolbarFontFamily

Sets the font for the toolbar and the viewer menu. The default font of the selected theme is used.

ToolbarAlignment

Sets the alignment mode for the controls on the viewer toolbar. It can take one of the following values of the StiContentAlignment enumeration:

 

Left – elements will be aligned left;

Center – elements will be centered;

Right – elements will be aligned right;

Default – the alignment depends on the RightToLeft property (default value).

ShowButtonCaptions

Enables text of the buttons on the toolbar of the viewer. By default, the property is set to true.

ShowPrintButton

Enables showing the button - Print - on the toolbar of the viewer. By default, the property is set to true.

ShowOpenButton

Enables displaying the Open button on the toolbar of the viewer when viewing reports or dashboards. By default, the property is set to false.

ShowSaveButton

Enables displaying the Save button on the toolbar of the viewer when viewing reports or dashboards.. By default, the property is set to true.

ShowSendEmailButton

Enables showing the button - Send Email - on the toolbar of the viewer. By default, the property is set to false. Also, you should add the OnEmailReport event handler.

ShowFindButton

Enables showing the button - Find - on the toolbar of the viewer. By default, the property is set to true.

ShowBookmarksButton

Enables showing the button - Bookmarks - on the toolbar of the viewer. By default, the property is set to true. If the button is hidden, the bookmarks panel will not be displayed even if there are bookmarks in the report.

ShowParametersButton

Enables showing the button - Parameters - on the toolbar of the viewer. By default, the property is set to true. If the button is hidden, the parameters panel will not be displayed even if there are parameters in the report.

ShowResourcesButton

Enables showing the button - Resources - on the toolbar of the viewer. By default, the property is set to true. If the button is hidden, the resources panel will not be displayed even if there are resources in the report.

ShowEditorButton

Enables showing the button - Editor - on the toolbar of the viewer. By default, the property is set to true.

ShowFullScreenButton

Enables displaying the Full Screen button on the toolbar of the viewer when viewing reports or dashboards.. By default, the property is set to true.

ShowFirstPageButton

Enables showing the button - First Page - on the toolbar of the viewer. By default, the property is set to true.

ShowPreviousPageButton

Enables showing the button - Previous Page - on the toolbar of the viewer. By default, the property is set to true.

ShowCurrentPageControl

Enables showing the current report page indicator. By default, the property is set to true.

ShowNextPageButton

Enables showing the button - Next Page - on the toolbar of the viewer. By default, the property is set to true.

ShowLastPageButton

Enables showing the button - Last Page - on the toolbar of the viewer. By default, the property is set to true.

ShowZoomButton

Enables showing the report zoom button. By default, the property is set to true.

ShowViewModeButton

Enables showing the button for selecting the display mode of report pages. By default, the property is set to true.

ShowDesignButton

Enables displaying the Design button on the toolbar of the viewer when viewing reports or dashboards.. By default, the property is set to false.

ShowAboutButton

Enables showing the button - About - on the toolbar of the viewer. By default, the property is set to true.

ShowRefreshButton

Sets a visibility of the Refresh button in the toolbar of the viewer. By default, the property is set to true.

ShowPinToolbarButton

Enables displaying of the Pin Toolbar button on the viewer's toolbar. The button is available only in the Mobile mode of the viewer's interface. The default value of the property is true.

PrintDestination

Sets the report printing mode. It can take one of the following values of the StiPrintDestination enumeration:

 

Default – a menu with a choice of printing modes will be displayed (default value);

Pdf – printing will be done in the PDF format;

Direct – printing will be done to the HTML format directly to the printer, the system print dialog will be displayed;

PopupWindow – printing will be done in the HTML format via the preview window of the report.

ViewMode

Sets the mode for displaying report pages. It can take one of the following values of the StiWebViewMode enumeration values:

 

SinglePage - displays one page of the report selected in the toolbar of the viewer (default value);

Continuous - displays all pages of the report;

MultiplePages - displays all report pages as a table.

Zoom

Sets the zoom for displaying report pages. The default setting is 100 percent. The values are from 10 to 500 percent. You can also set one of the following values:

 

StiZoomMode.PageWidth – when the viewer runs, the zoom, necessary to display the report by the page width, will be set;

StiZoomMode.PageHeight – when the viewer runs, the zoom, required to display the page height of the report, will be set.

MenuAnimation

Enables animation when the viewer menu shows/hides. By default, the property is set to true.

ShowMenuMode

Sets the display mode of the viewer menu. It can take one of the following values of the StiShowMenuMode enumeration:

 

Click – shows menu by mouse click (default value);

Hover – shows menu by hovering the mouse cursor.

AutoHideToolbar

Enables auto-hiding of the viewer's toolbar. The property will work only for the Mobile mode of the viewer's interface. The default value of the property is true.

 

Samples

 

See samples how to add a custom button on the toolbar of the viewer.

 

 

 

Export report

 

Name

Description

DefaultExportSettings

This group of properties is used to specify the default export settings for each export type. These settings will be applied to the export dialogs when the viewer runs or to the report, if export dialogs are disabled.

StoreExportSettings

Enables saving selected settings in the export dialogs. Settings will be stored in browser cookies. By default, the property is set to true.

ShowExportDialog

Enables showing export options dialog box. If the property is set to false, the export will be done with the default settings. By default, the property is set to true.

ShowExportToDocument

Enables the export menu item - Document File. By default, the property is set to true.

ShowExportToPdf

Enables displaying the Adobe PDF file export menu item when viewing reports, and the Adobe PDF item when viewing dashboards. By default, the property is set to true.

ShowExportToXps

Enables the export menu item - Microsoft XPS File. By default, the property is set to true.

ShowExportToPowerPoint

Enables the export menu item - Microsoft PowerPoint 2007/2010 File. By default, the property is set to true.

ShowExportToHtml

Enables the export menu item - File. By default, the property is set to true.

ShowExportToHtml5

Enables the export menu item - HTML5 File. By default, the property is set to true.

ShowExportToMht

Enables the export menu item - MHT Web Archive. By default, the property is set to true.

ShowExportToText

Enables the export menu item - Text File. By default, the property is set to true.

ShowExportToRtf

Enables the export menu item - Rich Text File. By default, the property is set to true.

ShowExportToWord2007

Enables the export menu item - Microsoft Word 2007/2010 File. By default, the property is set to true.

ShowExportToOpenDocumentWriter

Enables the export menu item - OpenDocument Writer File. By default, the property is set to true.

ShowExportToExcel

Enables the export menu item Microsoft Excel File. By default, the property is set to true.

ShowExportToExcelXml

Enables the export menu item - Microsoft Excel Xml File. By default, the property is set to true.

ShowExportToExcel2007

Enables displaying the Microsoft Excel 2007/2010 File export menu item when viewing reports, and the Microsoft Excel item when viewing dashboards. By default, the property is set to true.

ShowExportToOpenDocumentCalc

Enables the export menu item - OpenDocument Calc File. By default, the property is set to true.

ShowExportToCsv

Enables the export menu item - CSV File. By default, the property is set to true.

ShowExportToDbf

Enables the export menu item - DBF File. By default, the property is set to true.

ShowExportToXml

Enables the export menu item - XML File. By default, the property is set to true.

ShowExportToDif

Enables the export menu item - Data Interchange Format (DIF) File. By default, the property is set to true.

ShowExportToSylk

Enables the export menu item - Symbolic Link (SYLK) File. By default, the property is set to true.

ShowExportToJson

Enables the export menu item - JSON File. By default, the property is set to true.

ShowExportToImageBmp

Enables displaying the BMP Image export menu item when viewing reports, and the BMP Image item when viewing dashboards. By default, the property is set to true.

ShowExportToImageGif

Enables displaying the GIF Image export menu item when viewing reports, and the GIF Image item when viewing dashboards. By default, the property is set to true.

ShowExportToImageJpeg

Enables displaying the JPEG Image export menu item when viewing reports, and the JPEG Image item when viewing dashboards. By default, the property is set to true.

ShowExportToImagePcx

Enables displaying the PCX Image export menu item when viewing reports, and the PCX Image item when viewing dashboards. By default, the property is set to true.

ShowExportToImagePng

Enables displaying the PNG Image export menu item when viewing reports, and the PNG Image item when viewing dashboards. By default, the property is set to true.

ShowExportToImageTiff

Enables displaying the TIFF Image export menu item when viewing reports, and the TIFF Image item when viewing dashboards. By default, the property is set to true.

ShowExportToImageMetafile

Enables displaying the Windows Metafile export menu item when viewing reports, and the Windows Metafile item when viewing dashboards. By default, the property is set to true.

ShowExportToImageSvg

Enables displaying the Scalable Vector Graphics (SVG) File export menu item when viewing reports, and the Scalable Vector Graphics (SVG) File item when viewing dashboards. By default, the property is set to true.

ShowExportToImageSvgz

Enables displaying the Compressed SVG (SVGZ) File export menu item when viewing reports, and the Compressed SVG (SVGZ) File item when viewing dashboards. By default, the property is set to true.

ShowOpenAfterExport

Enables displaying the Open After Export parameter in export settings menu. By default, the property is set to true.

 

 

Sending report by Email

 

Name

Description

ShowEmailDialog

Enables displaying settings for sending the report via email. If the dialog box is disabled, the email will be sent with the settings set on the server-side in the OnEmailReport event. By default, the property is set to true.

ShowEmailExportDialog

Enables displaying export options dialog box when sending email. If the property is set to false, the export will be done with the default settings. By default, the property is set to true.

DefaultEmailAddress

Sets the default recipient email, i.e. the address to which the email with the attached report will be sent.

DefaultEmailSubject

Sets the default email subject (header).

DefaultEmailMessage

Sets the default email message (text).