How to remove or hide the main tab section in Crystal Report Viewer (C#).
A:
Go into ControlPanel select Add or Remove Programs scroll down to Crystal Reports Click on Remove button.
dar7yl
2009-05-27 19:07:48
ooo - someone doesn't have a sense of humor
dar7yl
2009-08-27 17:54:41
Oh, I'm sure they do. They just don't like seeing useless answers.
David Brown
2009-12-13 23:00:41
A:
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;
}
}
omid
2009-08-24 20:54:47
A:
sorry, now I saw that you ask for "tap section" within the meaning of "main report". how will I know how to remove it will tell you. Rafal
rafalba
2009-12-13 22:57:42
A:
Omid's answer is correct, but you have to make sure to do that stuff after you have set the viewer's ReportSource. The version in my function below is a little more robust, and makes what's going on a little clearer, though I'm still not sure why doing that bit of magic to the TabControl's ItemSize and SizeMode make the tab bar go away.
// 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;
}
}
}
}
}
Jeff Roe
2010-05-03 21:44:31
A:
Thanks.
In VB it should seem like this:
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
kadghar
2010-06-01 20:19:44
A:
Hi , How do we do this in a Web form in Visual Studio 2010? The TabControl is not available. Thanks in advance. - Sushmita
Sushmita
2010-07-14 00:15:36