Wednesday, March 31, 2010

Suppress Crystal Report Viewer's Main Report Tab

public static void SuppressReportTabs(
    this CrystalDecisions.Windows.Forms.CrystalReportViewer crv)
{
    foreach (System.Windows.Forms.Control control in crv.Controls)
        if (control is CrystalDecisions.Windows.Forms.PageView)
        {
            var tab = 
                (control as CrystalDecisions.Windows.Forms.PageView)
                .Controls[0] as System.Windows.Forms.TabControl;

            tab.ItemSize = new System.Drawing.Size(0, 1);
            tab.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
            tab.Appearance = System.Windows.Forms.TabAppearance.Buttons;
        }
} 

No comments:

Post a Comment