Show Crystal Report Using VB 6.0 and Access Database

 

Write this code in VB6.0

Private Sub Command1_Click()

CrystalReport1.WindowState = crptMaximized
CrystalReport1.DiscardSavedData = True
CrystalReport1.ReportFileName = “DatabasePath”
CrystalReport1.DataFiles(0) = “ReportPath”

If you want to pass value from vb6.0 to Crystal Report

‘CrystalReport1.Formulas(0) = “FDate='” & fromDate & “‘”

Optional If you use password protected database
‘CrystalReport1.Password = Chr$(10) & “sanjoy-pakiza”

Optional If you use Selection Formula
‘CrystalReport1.SelectionFormula = “{tblEmployeePersonalInfo.EID}=” &  1
CrystalReport1.WindowShowPrintBtn = True
CrystalReport1.WindowShowPrintSetupBtn = True
CrystalReport1.Action = 1

End Sub

Advertisements

2 thoughts on “Show Crystal Report Using VB 6.0 and Access Database

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s