NavigateTab Class
Provides functionality for a tab displayed a report in the Web Report Designer.
#Declaration
export class NavigateTab extends Disposable implements INavigateTab
#Remarks
You can use the Report Designer’s GetTabs method to obtain all currently opened tabs.
#Implements
#Properties
#displayName Property
Specifies the display name of the current tab.
#Declaration
displayName: ko.Computed<string>
#Property Value
Type | Description |
---|---|
Computed<string> | A knockout computed string that specifies the tab’s display name. |
#isModified Property
Specifies whether the report in the current tab has been changed.
#Declaration
isModified: ko.Observable<boolean> | ko.Computed<boolean>
#Property Value
Type |
---|
Observable<boolean> |
Computed<boolean> |
#Example
The following code demonstrates how to save a modified report in the active tab, and how to save all modified reports in the Report Designer.
<script type="text/javascript" id="script">
// Saves a modified report in the active tab
// and clears the modification flag.
function saveCurrentReport() {
if (reportDesigner.IsModified()) {
reportDesigner.SaveNewReport("Rep1");
reportDesigner.ResetIsModified();
}
};
// Saves modified reports in all tabs,
// clears the modification flags,
// displays a message when the report is successfully saved.
function saveAllReports() {
var tabs = reportDesigner.GetTabs();
tabs.forEach(tab => {
if (tab.isModified()) {
if (!tab.url()) tab.url('Report' + Date.now());
reportDesigner.ReportStorageSetData(tab.context().report.serialize(), tab.url())
.done(function (result) {
tab.resetIsModified();
DevExpress.Analytics.Internal.ShowMessage(DevExpress.Analytics.Utils.getLocalization("The report has been successfully saved.",
"ASPxReportsStringId.ReportDesigner_SaveReport_Message_OK"), DevExpress.Analytics.Internal.NotifyType.success);
});
}
});
};
</script>
@{
var designerRender = Html.DevExpress().ReportDesigner("reportDesigner")
.Height("1000px")
.Bind("TestReport");
@designerRender.RenderHtml()
}
@section Scripts {
// ...
}
#report Property
Specifies a report opened in the current tab.
#Declaration
report: ko.Computed<DevExpress.Reporting.Designer.Controls.ReportViewModel>
#Property Value
Type |
---|
Computed<Report |
#undoEngine Property
Specifies an engine that manages undo and redo operations in the Web Report Designer.
#Declaration
undoEngine: DevExpress.Analytics.Utils.UndoEngine
#Property Value
Type | Description |
---|---|
Undo |
An object that specifies an undo/redo engine. |
#url Property
Specifies the URL of a report opened in the current tab.
#Declaration
url: ko.Computed<string>
#Property Value
Type | Description |
---|---|
Computed<string> | A knockout computed string that specifies the report URL. |
#Methods
#refresh(resetState) Method
Reopens an assigned report.
#Declaration
refresh(
resetState: boolean
): void
#Parameters
Name | Type |
---|---|
reset |
boolean |
#Remarks
The refresh method reopens a report assigned to the current tab without saving changes made to this report. This method works only if you implemented a custom server-side report storage.
The following code snippet demonstrates how to use the client-side GetCurrentTab method to get the currently active Report Designer tab and reopen an assigned report.
<script type="text/javascript">
function Refresh() {
var tab = reportDesigner.GetCurrentTab();
tab.refresh();
}
</script>
<div onclick="Refresh()">Refresh</div>
<dx:ASPxReportDesigner ID="ASPxReportDesigner1" ClientInstanceName="reportDesigner" runat="server" />
#resetIsModified Method
Resets the value returned by the isModified property.
#Declaration
resetIsModified(): void
#Remarks
The following code snippet demonstrates how to reset the isModified property value for all Report Designer tabs. To obtain these tabs, use the GetTabs method.
<script type="text/javascript">
function ResetIsModified() {
reportDesigner.GetTabs().forEach(function (item) { item.resetIsModified(); })
}
</script>
<div onclick="ResetIsModified()">Reset IsModified</div>
<dx:ASPxReportDesigner ID="ASPxReportDesigner1" ClientInstanceName="reportDesigner" runat="server"/>