Novice: How To Create, Display, And Print An Access Report With Visual Basic 2005

  • Thread starter Thread starter clusardi2k
  • Start date Start date
C

clusardi2k

Hello, having never used CR before, I have an Access database with one
table that I use with VB. How do I print and view a report of this
table?

Is there any step by step documentation on the Internet?


I purchased "Crystal Reports 10" yesterday but find it doesn't have
detailed steps, so at least I'll read it!


Thank you,
Christopher Lusardi
 
When I use the below button click to open the report, the "close
current view" button on the menu doesn't close the report. What do I do
to the below subroutine to enable the capability?

Is there anything else I can do to improve this subroutine?

Thanks,
Chris Lusardi

Imports CrystalDecisions.CrystalReports.Engine

Private Sub Report_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Report.Click
Dim CrystalReport1 As New ReportDocument

Me.WindowState = FormWindowState.Maximized
CrystalReportViewer1.Visible = True
CrystalReport1.Load("C:\Documents and
Settings\chrislusardi\Desktop\CrystalReport1.rpt")

CrystalReportViewer1.ReportSource = CrystalReport1
CrystalReportViewer1.Zoom(100)
End Sub
 
Clusardi,

Try to mail it to Peter Proost. His email is as one of the emails on our
website, be aware that he is very busy at the moment so don't blaim him as
he does not give a reaction.

Cor
 
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:p[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
 
Cor said:
Clusardi,

Try to mail it to Peter Proost. His email is as one of the emails on our
website, be aware that he is very busy at the moment so don't blaim him as
he does not give a reaction.

Hello again,

After contacting Peter, my application has 2 buttons. One button
"creates" the
viewer (enables it and make it visible) while the close button hides
and disables the
this 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\Christopher\Desktop\Test\Test_Program\CrystalRepor­t1.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
 
Christopher,

Peter has responsed back to me twice, that he is answering your question
This for the Microsoft guys if they want to add to this thread.

If that does not fullfil your question, reply than

Cor

<[email protected]> schreef in bericht
Cor said:
Clusardi,

Try to mail it to Peter Proost. His email is as one of the emails on our
website, be aware that he is very busy at the moment so don't blaim him as
he does not give a reaction.

Hello again,

After contacting Peter, my application has 2 buttons. One button
"creates" the
viewer (enables it and make it visible) while the close button hides
and disables the
this 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\Christopher\Desktop\Test\Test_Program\CrystalRepor­t1.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
 
Back
Top