Results 1 to 4 of 4

Thread: Need help having data without the command... crystal report 9

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2007
    Posts
    839

    Question Need help having data without the command... crystal report 9

    hi, here is my problem...

    upon loading my crystal report there is default load data is already display in the
    screen even if i didn't assign it yet....

    i'm using excel database and i like it to the access then i made querry there and that is what i'm using for this report... called "RSOquerryFinal"

    UsePrintRSONO_rpt can have the value upon clicking the print button by getting the RSONO

    now, it's should be print the RSONO number that has in my RSO textbox but it is not printing the selected RSONO number instead of having the default data which the first RSONO number in the database...

    why is like that? help me please i can't find the where is locking here..

    help please..?

    now, here is my code
    =====================================================


    private sub form_load

    Dim newRep As New CrystalReportFillBy
    OpenConnection()
    GetRecords(UsePrintRSONO_rpt)
    newRep.SetDataSource(ds)
    newRep.Refresh()
    CrystalReportViewer1.RefreshReport()
    getRsoNoToBePrint()


    end sub



    Private Sub openconnection()
    If cn.State = ConnectionState.Closed Then
    cn = New OleDbConnection
    cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\ph-suman\rso\Rsodb.mdb;User Id=admin;Password=;"
    cn.Open()
    End If
    End Sub



    Private Sub GetRecords(ByVal UsePrinRSONO As String)

    Try

    ds = New DataSet
    Dim cmd As New OleDbCommand
    cmd.Connection = cn
    cmd.CommandType = CommandType.Text
    cmd.CommandText = "SELECT * from RSOQuerryFinal where RsoNo='" & UsePrinRSONO & "'"
    da = New OleDbDataAdapter
    da.SelectCommand = cmd
    da.Fill(ds, "RSOQuerryFinal")


    Catch ex As Exception
    MsgBox(ex.ToString)
    MsgBox(ex.Message)
    End Try

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2007
    Posts
    839

    Re: Need help having data without the command... crystal report 9

    and how could i prevent in openning new form report..?

    because everytime i press the print button it always open new form report instead refreshing the form....

    how could i make it..?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2007
    Posts
    839

    Re: Need help having data without the command... crystal report 9

    why i got error here

    object not reference for an instance...


    GetRecords(UsePrintRSONO_rpt)
    crystalReport.SetDataSource(ds)
    crystalReport.Refresh()
    CrystalReportViewer1.ReportSource = crystalReport]


    cam anyone help..?

  4. #4
    Member
    Join Date
    Nov 2006
    Posts
    38

    Smile Re: Need help having data without the command... crystal report 9

    Quote Originally Posted by edgarbenilde
    why i got error here

    object not reference for an instance...


    GetRecords(UsePrintRSONO_rpt)
    crystalReport.SetDataSource(ds)
    crystalReport.Refresh()
    CrystalReportViewer1.ReportSource = crystalReport]


    cam anyone help..?
    hey you forgot to initialize your dataset (ds)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width