Skip to main content
All docs
V18.2

ASPxClientReportDesigner.CloseTab(ASPxDesignerNavigateTab, Boolean) Method

Closes the specified report tab avaialble the Web Report Designer silently or with the Save Report dialog.

Namespace: DevExpress.XtraReports.Web.Scripts

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

Declaration

public void CloseTab(
    ASPxDesignerNavigateTab tab,
    bool force
)

Parameters

Name Type Description
tab ASPxDesignerNavigateTab

Specifies the Report Designer tab to close.

force Boolean

true, to silently close the tab; false to show the Save Report dialog.

Remarks

The CloseTab method enables you to close the required Report Designer tab. The force parameter determines whether to show the Save Report dialog if the assigned report contains unsaved changes.

  • If the parameter is set to true, the tab is closed silently without saving the changes and showing this dialog.
  • If the parameter is set to false, the Save Report dialog appears (the same behavior as when you call the CloseTab method without the force parameter).

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