problem with report

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Henri

    problem with report

    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
    crystalreportvi ewer, configure its property "reportSour ce"

    this method requires code which fills the dataset of our SQL's data and pass
    it to our report with the "setdatasou rce" 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(B yVal sender As System.Object, ByVal e As
    System.EventArg s) Handles Button1.Click

    Dim conexion As New OleDb.OleDbConn ection(gCadenaC onexion)

    Dim sql As String = "SELECT AtributoPublico Objetivo.* FROM PublicoObjetivo
    INNER JOIN AtributoPublico Objetivo ON PublicoObjetivo .IDPublicoObjet ivo =
    AtributoPublico Objetivo.IDPubl icoObjetivo WHERE (PublicoObjetiv o.IDPlan)=" &
    gIdPlan

    Dim adapter As New OleDb.OleDbData Adapter(sql, conexion)

    Dim dataset As New DataSet()

    adapter.Fill(da taset, "AtributoPublic oObjetivo")

    rpt.SetDataSour ce(dataset)

    fbase.CrystalRe portViewer1.Rep ortSource = rpt

    fbase.CrystalRe portViewer1.Zoo m(75)

    fbase.StartPosi tion = FormStartPositi on.Manual

    fbase.Location = New Point(0, 0)

    fbase.MdiParent = fPrincipal

    fbase.Show()

    end sub



Working...