0

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 :)

2
Contributors
3
Replies
6
Views
5 Years
Discussion Span
Last Post by kingsonprisonic
Featured Replies
  • Use this [CODE] mystr = "{grading_teacherload.teacherid} = " & teacherLoadListView.teacherid.ToString & "" [/CODE] As teacherLoadListView.teacherid is an integer so u have to convert it to string... Read More

1

Use this

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

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.