Results 1 to 3 of 3

Thread: [RESOLVED] Passing 'values' to generate reports

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    52

    Resolved [RESOLVED] Passing 'values' to generate reports

    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.

    VB Code:
    1. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    2.         OleCon.Close()
    3.         Dim ADOcon As New ADODB.Connection()
    4.  
    5.         ADOcon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\REPORTS_DB\TEST_CRY_0016.mdb;Jet OLEDB:Database Password=prax;"
    6.         OleCon.ConnectionString = ADOcon.ConnectionString
    7.  
    8.         Dim repDA As New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM testinfo WHERE testscore > 50", OleCon)
    9.         Dim MyCmdBuilderDT_rep As New System.Data.OleDb.OleDbCommandBuilder(repDA)
    10.  
    11.         repDA.Fill(repDS)
    12.         DataGrid1.DataSource = repDS.Tables(1)
    13.         MsgBox("pause")
    14.  
    15.         rptCrewRecord.Load("..\CrystalReport2.rpt")
    16.         rptCrewRecord.SetDataSource(repDS)
    17.  
    18.         Dim viewReport As New ReportView()
    19.         'Set the Parent Form of the Child window.
    20.  
    21.         'Display the new
    22.  
    23.         viewReport.ShowDialog()
    24.  
    25.  
    26.     End Sub
    Last edited by Hack; Mar 2nd, 2006 at 07:32 AM. Reason: Added [vbcode] [/vbcode] tags and for more clarity.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width