Connect VB.Net with Seagate Crystal Report

Taufiq

New member
Joined
Jul 9, 2007
Messages
2
Programming Experience
Beginner
Can You help me??

I need to connect my application in VB. net with seagate crystal report..

But I want to make some filtering in my report..

SO.. where should I put the SQL Query??? in coding application or in crystal report???

can You give me some example..??

Thanks..
 
You can do it both ways.

I'm no expert, but this is how I do it in code:

VB.NET:
Public Sub GenerateYourList()
    Dim objConn As OleDbConnection
    Dim daT1 As OleDbDataAdapter
    Dim DataSet1 As DataSet
    Dim strConnection As String
    Dim strSQL As String

        strConnection = "provider=Microsoft.Jet.OLEDB.4.0;data source=" & Application.StartupPath & "\MyCustomers.mdb"

        objConn = New OleDb.OleDbConnection(strConnection)
        objConn.Open()

        strSQL = "SELECT * FROM YourTable"
        daT1 = New OleDbDataAdapter(strSQL, objConn)
        DataSet1 = New DataSet
        daT1.Fill(DataSet1, "YourTable")

        Dim rpt As New rptYourList

        FrmReport.CrystalReportViewer.SelectionFormula = "{YourTable.Status} > " & "''Current''"
        rpt.SetDataSource(DataSet1)
        FrmReport.CrystalReportViewer.ReportSource = rpt
     
        objConn.Close()
    End Sub
 
Thanks Freerider,

I'll try your advice..

But, should I use the Crystal Report that included in my VB.Net??
can I use the other Crystal Report??
what's the different?? are they have the same step and the same code???
 
Back
Top