problem with report

H

Henri

hi all,

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 but when i try it with several tables,
it's imposible

have you got any idea?


thanks a lot for your interest


here is my code:
Private fbase As New fInformeBase()

Private rpt As CrystalReport1 = New CrystalReport1()

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim conexion As New OleDb.OleDbConnection(gCadenaConexion)

Dim sql As String = "SELECT AtributoPublicoObjetivo.* FROM PublicoObjetivo
INNER JOIN AtributoPublicoObjetivo ON PublicoObjetivo.IDPublicoObjetivo =
AtributoPublicoObjetivo.IDPublicoObjetivo WHERE (PublicoObjetivo.IDPlan)=" &
gIdPlan

Dim adapter As New OleDb.OleDbDataAdapter(sql, conexion)

Dim dataset As New DataSet()

adapter.Fill(dataset, "AtributoPublicoObjetivo")

rpt.SetDataSource(dataset)

fbase.CrystalReportViewer1.ReportSource = rpt

fbase.CrystalReportViewer1.Zoom(75)

fbase.StartPosition = FormStartPosition.Manual

fbase.Location = New Point(0, 0)

fbase.MdiParent = fPrincipal

fbase.Show()

end sub
 
S

SaiPavan

To work with more than one table always get the output of
the required conditions into a dataset from the first
priority table. later using these values as input to a
query get the output in datareader and use this as
datasource.

-----Original Message-----
hi all,

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 but when i try it with several tables,
it's imposible

have you got any idea?


thanks a lot for your interest


here is my code:
Private fbase As New fInformeBase()

Private rpt As CrystalReport1 = New CrystalReport1()

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim conexion As New OleDb.OleDbConnection(gCadenaConexion)

Dim sql As String = "SELECT AtributoPublicoObjetivo.* FROM PublicoObjetivo
INNER JOIN AtributoPublicoObjetivo ON
PublicoObjetivo.IDPublicoObjetivo =
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top