Hello,
The program, currently, has 2 buttons. One button "creates" the
viewer (enables it and make it visible) while the close button hides
and disables the close button. On start-up, the close button is also
disabled and not visible.
Is this okay with you? How would you modify it?
Note: I never explicitly do a "dispose"!
Christopher Lusardi
P.S.: I sent this article to Peter.
'-------------------------------------------------------------------------------------------------
Imports CrystalDecisions.CrystalReports.Engine
Public Class Test
Dim CrystalReport1 As New ReportDocument
'----------------SUB--------------------
Private Sub Open_Report_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Open_Report.Click
Me.WindowState = FormWindowState.Maximized
CrystalReportViewer1.Enabled = True
CrystalReportViewer1.Visible = True
CrystalReport1.Load("C:\Documents and
Settings\lusardicm\Desktop\EQUIPMENT
DATABASE\Equipment_Database_Program\Equipment_Database_Program\CrystalReport1.rpt")
CrystalReportViewer1.ReportSource = CrystalReport1
CrystalReportViewer1.Zoom(100)
Close_Report.Visible = True
Close_Report.Enabled = True
End Sub
'-----------------SUB-------------------
Private Sub Close_Report_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Close_Report.Click
CrystalReportViewer1.Visible = False
CrystalReportViewer1.Enabled = False
Close_Report.Visible = False
Close_Report.Enabled = False
End Sub
End Class
-----Original Message-----
From: Peter Proost [mailto
[email protected]]
Sent: Tuesday, May 23, 2006 1:51 AM
To: Lusardi, Christopher AMRDEC/Boeing
Cc: (e-mail address removed)
Subject: Re: A question about VB tips?
Hi Christopher,
here's an explanation about the showCloseButton (close current view
button), the button is used to close a page of a report but not the
report itself. For example if you've got a report that's grouped by
some value, you can double click on the report to show only the records
that belong to that group. This creates what crystal reports calls a
"view tab" if you then want to return to the original report you need
to push the close button (red cross in crystal report viewer) to close
that "view tab" but you can't use the button to close the initial
report.
I hope this helps
Greetz Peter Proost
Below is the help text from .net
CloseView (ByVal viewURI As Object)
Parameters
ViewURI
Indicates a string value that contains the name of the view tab.
Remarks
This method can either take the name of a view tab or a null value. A
null value closes the current view. The main view cannot be closed