locked
how to making dataset for subreport and main report crystal report with asp.net RRS feed

  • Question

  • User50404389 posted

    i have code :

    Dim CN As SqlConnection
    Dim MyConnectionString As String = Nothing
    MyConnectionString = "Data Source=777.77.77.77,77000;Initial Catalog=aaa;User ID=sa;Password=!!!!!!!!!!!!1"
    CN = New SqlConnection(MyConnectionString)

    Dim SQL As String = Nothing
    SQL = "Select * from bDataPersonal1 where UserKd = '" & ddAnggota.Value & "'"
    Dim SQL1 As String = Nothing
    SQL1 = "Select * from bDataPersonal2 where UserKd = '" & ddAnggota.Value & "'"
    Dim myDA As New SqlDataAdapter(SQL, CN)
    Dim myDA1 As New SqlDataAdapter(SQL1, CN)
    CN.Close()

    Dim DS As New DataSet
    myDA.Fill(DS, "bDataPersonal1")
    myDA1.Fill(DS, "bDataPersonal2")
    MyRpt = New ReportDocument

    MyRpt.Load(Server.MapPath("~/Report/user02.rpt"))
    MyRpt.SetDataSource(DS)
    MyRpt.SetParameterValue("pUserName", ddAnggota.Value)

    MyRpt.Subreports("~/Report/crPurposeOfCareers.rpt").SetDataSource(DS.Tables(1))
    crViewer1.ReportSource = MyRpt

    can u help me? i don't find anything wrong but my report can't show

    best regards,

    Thursday, October 6, 2016 1:14 AM

Answers

All replies