I have this code in my form (in load event) wherein there is a crystal report viewer:

Dim oDoc As New ReportDocument
        oDoc.Load("D:\grading_report\grading_report\teacherLoad.rpt")

        Dim myDS As New DataSet
        oDoc.SetDataSource(myDS.Tables("grading_teacherload"))
        Dim mystr As String
        mystr = "{grading_teacherload.teacherid} = " & teacherLoadListView.teacherid & ""

        CrystalReportViewer1.SelectionFormula = mystr
        CrystalReportViewer1.ReportSource = oDoc

there is a "A number is required here" error in mystr = "{grading_teacherload.teacherid} = " & teacherLoadListView.teacherid & ""
and teacherLoadListView.teacherid is declared as integer in teacherLoadListView form...

how can I solve this error?
any help is appreciated... thanks :)

Recommended Answers

All 3 Replies

Use this

mystr = "{grading_teacherload.teacherid} = " & teacherLoadListView.teacherid.ToString & ""

As teacherLoadListView.teacherid is an integer so u have to convert it to string...

thanks so much kingsonprisonic... :)

Dont forget to give reputation and mark this thread as solved..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.