H
Henri
hi,
i'm using the "insertion model" of ADO.NET to see my reports. this model is
the desconnected model of NET.
i have to create a dataset object (visual dataset schema), base my report on
it and after: a form with a crystalreportviewer, configure its property
"reportSource"
this method requires code which fills the dataset of our SQL's data and pass
it to our report with the "setdatasource" method.
i haven't any problem with one table or more tables but when i try filtering
data, it doesn't work
=> i saw the example of crystal report (pdf document) with 2 tables but not
filtered so i've got all the data, and i've tried to filter the data of the
first table in the SQL expresion and with the selectionFormula too. but it
was imposible.
here is the code:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Data
Imports System.Data.OleDb
Dim crReportDocument As New CrystalReport1()
Dim DataSet1 As DataSet
Dim adoOleDbConnection As OleDbConnection
Dim adoOleDbDataAdapter As OleDbDataAdapter
Dim adoOleDbDataAdapter2 As OleDbDataAdapter
Dim connectionString As String = ""
connectionString = "Provider=SQLOLEDB;"
connectionString += "Server=DBCONN1;Database=pubs;"
connectionString += "User ID=userid;Password=password"
adoOleDbConnection = New OleDbConnection(connectionString)
Dim sqlString As String = ""
sqlString = "SELECT * FROM authors"
adoOleDbDataAdapter = New OleDbDataAdapter(sqlString, adoOleDbConnection)
sqlString = "SELECT * FROM titleauthor"
adoOleDbDataAdapter2 = New OleDbDataAdapter(sqlString,
adoOleDbConnection)
DataSet1 = New DataSet()
adoOleDbDataAdapter.Fill(DataSet1, "authors")
adoOleDbDataAdapter2.Fill(DataSet1, "titleauthor")
crReportDocument.Database.Tables(0).SetDataSource(DataSet1)
thanks
i'm using the "insertion model" of ADO.NET to see my reports. this model is
the desconnected model of NET.
i have to create a dataset object (visual dataset schema), base my report on
it and after: a form with a crystalreportviewer, configure its property
"reportSource"
this method requires code which fills the dataset of our SQL's data and pass
it to our report with the "setdatasource" method.
i haven't any problem with one table or more tables but when i try filtering
data, it doesn't work
=> i saw the example of crystal report (pdf document) with 2 tables but not
filtered so i've got all the data, and i've tried to filter the data of the
first table in the SQL expresion and with the selectionFormula too. but it
was imposible.
here is the code:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Data
Imports System.Data.OleDb
Dim crReportDocument As New CrystalReport1()
Dim DataSet1 As DataSet
Dim adoOleDbConnection As OleDbConnection
Dim adoOleDbDataAdapter As OleDbDataAdapter
Dim adoOleDbDataAdapter2 As OleDbDataAdapter
Dim connectionString As String = ""
connectionString = "Provider=SQLOLEDB;"
connectionString += "Server=DBCONN1;Database=pubs;"
connectionString += "User ID=userid;Password=password"
adoOleDbConnection = New OleDbConnection(connectionString)
Dim sqlString As String = ""
sqlString = "SELECT * FROM authors"
adoOleDbDataAdapter = New OleDbDataAdapter(sqlString, adoOleDbConnection)
sqlString = "SELECT * FROM titleauthor"
adoOleDbDataAdapter2 = New OleDbDataAdapter(sqlString,
adoOleDbConnection)
DataSet1 = New DataSet()
adoOleDbDataAdapter.Fill(DataSet1, "authors")
adoOleDbDataAdapter2.Fill(DataSet1, "titleauthor")
crReportDocument.Database.Tables(0).SetDataSource(DataSet1)
thanks