Skip to main content
All docs
V18.2

ASPxClientReportDesigner.CloseTab(ASPxDesignerNavigateTab) Method

Closes the specified report tab available in the Web Report Designer.

Namespace: DevExpress.XtraReports.Web.Scripts

Assembly: DevExpress.XtraReports.v18.2.Web.Scripts.dll

Declaration

public void CloseTab(
    ASPxDesignerNavigateTab tab
)

Parameters

Name Type Description
tab ASPxDesignerNavigateTab

Specifies the Report Designer tab to close.

Remarks

The CloseTab method enables you to close the required Report Designer tab. The Save Report dialog appears if the assigned report contains unsaved changes.

Another CloseTab method overload with the force parameter allows you to close the tab silently without saving the changes and showing the Save Report dialog.

To obtain all available Report Designer tabs, call the GetTabs method.

You can also use the CloseCurrentTab method to close the currently active tab.

The following code snippet demonstrates how to use these methods.

<script type="text/javascript">
    function CloseSecondTab() {
        var tabs = reportDesigner.GetTabs();
        reportDesigner.CloseTab(tabs[1]);
    }

    function ForceCloseSecondTab() {
        var tabs = reportDesigner.GetTabs();
        reportDesigner.CloseTab(tabs[1], true);
    }
    function CloseCurrentTab() {
        reportDesigner.CloseCurrentTab();
    }
</script>

<div onclick="CloseSecondTab()">Close the Second Tab</div>
<div onclick="ForceCloseSecondTab()">Force Close the Second Tab</div>
<div onclick="CloseCurrentTab()">Close the Current Tab</div>
<dx:ASPxReportDesigner ID="ASPxReportDesigner1" ClientInstanceName="reportDesigner" runat="server"/>

You can handle the ReportTabClosing and ReportTabClosed events to respond to closing a report tab in the Web Report Designer.

See Also