rockadudele
Mar 2nd, 2006, 01:14 AM
Hi
I'd like to generate reports based on values that the user is able to input. I need to generate reports during runtime. Tried most methods but not able to make it work.
I'm using an MS access Database, VB .net 2002, Crystal reports for .NET
below is the code that i've tried working with.
What I get is a dialog box which requests for UserName and password which i dont want displayed. How could I avoid that?
Please help.
:confused: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
OleCon.Close()
Dim ADOcon As New ADODB.Connection()
ADOcon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\REPORTS_DB\TEST_CRY_0016.mdb;Jet OLEDB:Database Password=prax;"
OleCon.ConnectionString = ADOcon.ConnectionString
Dim repDA As New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM testinfo WHERE testscore > 50", OleCon)
Dim MyCmdBuilderDT_rep As New System.Data.OleDb.OleDbCommandBuilder(repDA)
repDA.Fill(repDS)
DataGrid1.DataSource = repDS.Tables(1)
MsgBox("pause")
rptCrewRecord.Load("..\CrystalReport2.rpt")
rptCrewRecord.SetDataSource(repDS)
Dim viewReport As New ReportView()
'Set the Parent Form of the Child window.
'Display the new
viewReport.ShowDialog()
End Sub
I'd like to generate reports based on values that the user is able to input. I need to generate reports during runtime. Tried most methods but not able to make it work.
I'm using an MS access Database, VB .net 2002, Crystal reports for .NET
below is the code that i've tried working with.
What I get is a dialog box which requests for UserName and password which i dont want displayed. How could I avoid that?
Please help.
:confused: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
OleCon.Close()
Dim ADOcon As New ADODB.Connection()
ADOcon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\REPORTS_DB\TEST_CRY_0016.mdb;Jet OLEDB:Database Password=prax;"
OleCon.ConnectionString = ADOcon.ConnectionString
Dim repDA As New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM testinfo WHERE testscore > 50", OleCon)
Dim MyCmdBuilderDT_rep As New System.Data.OleDb.OleDbCommandBuilder(repDA)
repDA.Fill(repDS)
DataGrid1.DataSource = repDS.Tables(1)
MsgBox("pause")
rptCrewRecord.Load("..\CrystalReport2.rpt")
rptCrewRecord.SetDataSource(repDS)
Dim viewReport As New ReportView()
'Set the Parent Form of the Child window.
'Display the new
viewReport.ShowDialog()
End Sub