代码之家  ›  专栏  ›  技术社区  ›  Mark

如何删除Crystal Report Viewer中的主选项卡?

  •  4
  • Mark  · 技术社区  · 16 年前

    6 回复  |  直到 16 年前
        1
  •  8
  •   Jeff Roe    15 年前

    奥米德的回答是正确的,但你必须确保做到这一点 设置查看器的ReportSource之后 . 我下面函数中的版本更健壮一些,并且使正在发生的事情更清楚一些,尽管我仍然不知道为什么对TabControl的ItemSize和SizeMode做那么一点魔术会使tab栏消失。

    // This is a method of a Form with one of these:
    //     CrystalDecisions.Windows.Forms.CrystalReportViewer
    // This hides the tab control with the "Main Report" button.
    public void hideTheTabControl()
    {
        System.Diagnostics.Debug.Assert(
            crystalReportViewer1.ReportSource != null, 
            "you have to set the ReportSource first");
    
        foreach (Control c1 in crystalReportViewer1.Controls)
        {
            if (c1 is CrystalDecisions.Windows.Forms.PageView)
            {
                PageView pv = (PageView)c1;
                foreach (Control c2 in pv.Controls)
                {
                    if (c2 is TabControl)
                    {
                        TabControl tc = (TabControl)c2;
                        tc.ItemSize = new Size(0, 1);
                        tc.SizeMode = TabSizeMode.Fixed;
                    }
                }
            }
        }
    }
    
        2
  •  3
  •   kadghar    15 年前

        For Each c1 As Control In CrystalReportViewer1.Controls
            If c1.GetType Is GetType(CrystalDecisions.Windows.Forms.PageView) Then
                Dim pv As CrystalDecisions.Windows.Forms.PageView = c1
                For Each c2 As Control In pv.Controls
                    If c2.GetType Is GetType(TabControl) Then
                        Dim tc As TabControl = c2
                        tc.ItemSize = New Size(0, 1)
                        tc.SizeMode = TabSizeMode.Fixed
                    End If
                Next
            End If
        Next
    
        3
  •  1
  •   Community CDub    4 年前

    解决方案水晶决策网控件

    jquery.js 在页面中并粘贴此脚本:

    <script type="text/javascript">
    $(document).ready(function () {
        $(".hideableFrame").hide();
    });
    

    解释

    我发现了 放置在 <tr> 具有 class="hideableFrame"

    <tr class="hideableFrame" valign="bottom" height="28" style="display: table-row;">
     <td>
       <img width="5" height="5" 
        ...
    

    我不能在办公室工作 css 文件,自 style:display 是写在元素上的,所以我编写了一个脚本来更改标记为 hideableFrame .

    ;此脚本将隐藏所有这些内容。

        4
  •  1
  •   kamskyleo    13 年前

    在你的网页上试试这个

    <CR:CrystalReportViewer ID="CrystalReportViewer1" 
                    runat="server"
                    CssClass="Report"
                     HasCrystalLogo="False" 
                     HasSearchButton="False"
                      HasToggleGroupTreeButton="False" 
                       HasZoomFactorList="False" 
                      Height="100%" Width="100%" 
                      meta:resourcekey="CrystalReportViewer1Resource1"
                      EnableDrillDown="False" 
                      ReuseParameterValuesOnRefresh="True" 
                      EnableToolTips="False" ToolPanelView="None" HasDrilldownTabs="False" 
                        HasDrillUpButton="False" /> 
    
        5
  •  0
  •   omid omid    15 年前
                foreach (Control control in crystalReportViewer1.Controls)
                {
    
                    if (control is CrystalDecisions.Windows.Forms.PageView)
                    {
    
                        TabControl tab = (TabControl)(CrystalDecisions.Windows.Forms.PageView)control).Controls[0];
    
                        tab.ItemSize = new Size(0, 1);
    
                        tab.SizeMode = TabSizeMode.Fixed;
    
                        tab.Appearance = TabAppearance.Buttons;
    
                    }
    
                }
    
        6
  •  0
  •   Khaled Elt    4 年前

    在CrystalReportViewer控件中设置HasDrilldownTabs=“false”

        7
  •  -1
  •   rafalba    15 年前

    crystalReportViewer1.DisplayStatusBar=假;