xtrareports-js-aspxclientdocumentviewer.md
The client-side equivalent of the ASPxWebDocumentViewer control.
declare class ASPxClientDocumentViewer extends ASPxClientControl
The following code illustrates how to access a document viewer on the client.
<dx:ASPxDocumentViewer ID="DocumentViewer1" runat="server"
ReportName="WebApplication2.XtraReport1"
ClientInstanceName="documentViewer1">
<ClientSideEvents PageLoad="function(s, e) {
var nextpage = e.PageIndex + 1 < e.PageCount ? e.PageIndex + 1 : 0;
setTimeout('switchPage(' + nextpage + ')', 5000);
}" />
</dx:ASPxDocumentViewer>
<script language="javascript" type="text/javascript">
function switchPage(nextPage) {
documentViewer1.GotoPage(nextPage);
}
</script>
SendMessageToAssistiveTechnology(message)
ASPxClientControlBase ASPxClientControl ASPxClientDocumentViewer
See Also
Converts the specified object to the current object’s type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress.
static Cast(
obj: any
): ASPxClientDocumentViewer
| Name | Type | Description |
|---|---|---|
| obj | any |
The client object to be type cast. Represents an instance of a DevExpress web control’s client object.
|
| Type | Description |
|---|---|
ASPxClientDocumentViewer |
An ASPxClientDocumentViewer object.
|
The Cast method is implemented as a part of the JavaScript IntelliSense support for DevExpress ASP.NET controls and MVC extensions. So, using the Cast method is sensible when you intend to use IntelliSense during writing JavaScript code at design time with the help of the DevExpress client API.
A call to the Cast method (which is a static method) casts the specified client object to the ASPxClientDocumentViewer type. As a result, the object’s type is now known and ASPxClientDocumentViewer type specific IntelliSense information can be displayed for this client object, facilitating your coding.
The examples of this method application are as follows.
Converting the event source object passed to a client event’s handler:
Converting a client object accessed by using the value of the ClientInstanceName (or ID ) property. For instance, if a web control’s ClientInstanceName property is set to ‘ASPxClientDocumentViewer1’, the object can be type cast in the following manner:
Provides access to the document of the ASPxClientDocumentViewer.
GetDocumentMap(): ASPxClientReportDocumentMap
| Type | Description |
|---|---|
| ASPxClientReportDocumentMap |
An ASPxClientReportDocumentMap object.
|
Provides access to the parameters panel of the ASPxClientDocumentViewer.
GetParametersPanel(): ASPxClientReportParametersPanel
| Type | Description |
|---|---|
| ASPxClientReportParametersPanel |
An ASPxClientReportParametersPanel object.
|
Provides access to the Ribbon of the ASPxClientDocumentViewer.
GetRibbonToolbar(): ASPxClientRibbon
| Type | Description |
|---|---|
| ASPxClientRibbon |
A Ribbon object.
|
Provides access to the Splitter of the ASPxClientDocumentViewer.
GetSplitter(): ASPxClientSplitter
| Type | Description |
|---|---|
| ASPxClientSplitter |
A Splitter object.
|
Provides access to the Document Viewer toolbar on the client.
GetToolbar(): ASPxClientReportToolbar
| Type | Description |
|---|---|
| ASPxClientReportToolbar |
An ASPxClientReportToolbar object.
|
Obsolete. Provides access to the ASPxClientDocumentViewer‘s preview that exposes methods to print and export the document.
GetViewer(): ASPxClientReportViewer
| Type | Description |
|---|---|
| ASPxClientReportViewer |
An ASPxClientReportViewer object.
|
Sets focus on the report control specified by its bookmark.
GotoBookmark(
pageIndex: number,
bookmarkPath: string
): void
| Name | Type | Description |
|---|---|---|
| pageIndex | number |
An integer value, specifying the page index.
| | bookmarkPath | string |
A String value, specifying the path to the bookmark.
|
Displays the specified report page.
GotoPage(
pageIndex: number
): void
| Name | Type | Description |
|---|---|---|
| pageIndex | number |
An integer value, identifying the report page.
|
Gets a value indicating whether or not searching text across a report is permitted in the web browser.
IsSearchAllowed(): boolean
| Type | Description |
|---|---|
| boolean |
true if searching text in the report is allowed; otherwise, false.
|
Prints the document’s page with the specified page index.
Print(
pageIndex?: number
): void
| Name | Type | Description |
|---|---|---|
| pageIndex | number |
A Int32 representing the index of the page to be printed.
|
Initiates a round trip to the server so that the current page will be reloaded.
Refresh(): void
Exports a report to a file of the specified format, and saves it to the disk.
SaveToDisk(
format: string
): void
| Name | Type | Description |
|---|---|---|
| format | string |
A string specifying the format to which a report should be exported.
|
The following export formats can be used as a format parameter passed to the SaveToDisk method:
Exports a report to a file of the specified format, and shows it in a new Web Browser window.
SaveToWindow(
format: string
): void
| Name | Type | Description |
|---|---|---|
| format | string |
A string specifying the format to which a report should be exported.
|
The following export formats can be used as a format parameter passed to the SaveToWindow method:
Invokes the Search dialog, which allows end-users to search for specific text in a report.
Search(): void
Note that the Search dialog can be invoked only if the ASPxClientDocumentViewer.IsSearchAllowed method returns true.
Occurs when a callback for server-side processing is initiated.
BeginCallback: ASPxClientEvent<ASPxClientBeginCallbackEventHandler<ASPxClientDocumentViewer>>
The BeginCallback event's data class is ASPxClientBeginCallbackEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| command | Gets a command name that identifies which client action initiated a callback. |
The BeginCallback and ASPxClientDocumentViewer.EndCallback events can be used to perform specific client-side actions while a callback is being processed on the server side.
Fires on the client if any server error occurs during server-side processing of a callback sent by ASPxClientDocumentViewer.
CallbackError: ASPxClientEvent<ASPxClientCallbackErrorEventHandler<ASPxClientDocumentViewer>>
The CallbackError event's data class is ASPxClientCallbackErrorEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| handled | Gets or sets whether the event is handled and the default error handling actions are not required. |
| message | Gets the error message that describes the server error that occurred. |
The CallbackError event enables you to properly respond to a server error occurring as a result of a callback being processed on the server side. You can handle this event to perform specific client-side actions, such as displaying explanatory text or an image related to the error, for example.
Typically, a server error which occurs during server-side processing of a callback leads to the web application hanging, because in this case, no proper response is generated for a control that initiated the callback. However, AJAX-enabled web controls from the DevExpress product line are able to automatically catch server errors occurring within handlers of their server-side events, and to pass the related error information to the client for further processing through the CallbackError event’s argument.
See Handling Callback Exceptions on Client to learn more.
See Also
Occurs on the client after a callback’s server-side processing has been completed.
EndCallback: ASPxClientEvent<ASPxClientEndCallbackEventHandler<ASPxClientDocumentViewer>>
The EndCallback event's data class is ASPxClientEndCallbackEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| command | Gets a command name that identifies which client action forced a callback to occur. |
The ASPxClientDocumentViewer.BeginCallback and EndCallback events can be used to perform specific client-side actions when a callback is being processed on a server.
Occurs on the client side when a report page is loaded into this ASPxClientDocumentViewer instance.
PageLoad: ASPxClientEvent<ASPxClientReportViewerPageLoadEventHandler<ASPxClientDocumentViewer>>
The PageLoad event's data class is ASPxClientReportViewerPageLoadEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| PageCount | Gets a value specifying the total number of pages displayed in a report viewer. |
| PageIndex | Gets a value specifying a zero-based index of a page to be displayed in a report viewer. |
The event data class exposes the following methods:
| Method | Description |
|---|---|
| IsFirstPage | Gets a value indicating whether a report page, which is currently loaded into the ASPxClientReportViewer, is the first page of a report. |
| IsLastPage | Gets a value indicating whether a report page, which is currently loaded into the ASPxClientReportViewer, is the last page of a report. |
Occurs when an item within the Document Viewer’s report toolbar is clicked.
ToolbarItemClick: ASPxClientEvent<ASPxClientEventHandler<ASPxClientDocumentViewer>>
The ToolbarItemClick event's data class is ASPxClientEventArgs.
Occurs when the value of an item within the Document Viewer’s report toolbar is changed.
ToolbarItemValueChanged: ASPxClientEvent<ASPxClientEventHandler<ASPxClientDocumentViewer>>
The ToolbarItemValueChanged event's data class is ASPxClientEventArgs.