zoukankan      html  css  js  c++  java
  • 水晶报表 隐藏主报表

    方法如下: private void FormatReportViewer() {

    CrystalDecisions.Windows.Forms.PageView oPageView = new CrystalDecisions.Windows.Forms.PageView();

    System.Windows.Forms.TabControl oControl = new TabControl();

    foreach(object tab in CrystalReportViewer1.Controls)

    {

    string sControl = tab.GetType().Name.ToString();

    if(sControl == "StatusBar") {

    CrystalReportViewer1.Controls[4].Visible = false;

    }

       if(sControl == "PageView") {

    oPageView = (CrystalDecisions.Windows.Forms.PageView)(tab);

    oControl = (TabControl)(oPageView.Controls[0]);

    oControl.ItemSize = new Size(0, 1);

    oControl.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;

    oControl.Appearance = System.Windows.Forms.TabAppearance.Buttons;

    } } }


    如何更改mainreport tab上的标题如下: 


    private void SetReportName(CrystalReportViewer CrystalReportViewer1, string newName) 

    foreach(Control control in CrystalReportViewer1.Controls) 

    if (control is CrystalDecisions.Windows.Forms.PageView) 

    foreach(Control controlInPage in control.Controls) 

    if (controlInPage is TabControl) 

    foreach(TabPage tabPage in (controlInPage as TabControl).TabPages) 

    if (tabPage.Text == "MainReport") 

    tabPage.Text = newName; 

    return; 

    }

  • 相关阅读:
    数字系统设计练习(一)—— 闪烁的小灯
    使用matplotlib时pyplot.show()图像不显示
    Linux命令——github篇
    Caffe: Cannot create Cublas handle. Cublas won't be available
    欧拉函数
    Prim最小生成树+优先队列优化
    KMP算法
    克鲁斯卡尔求最小生成树
    C++ 文件输出、输出
    并查集
  • 原文地址:https://www.cnblogs.com/eastday/p/1787618.html
Copyright © 2011-2022 走看看