|
-
Apr 14th, 2012, 04:21 AM
#1
Thread Starter
Junior Member
Error:conversion from string load report failed to type integer is not valid
Can you tell me why does this error happen ?and how can i solve it ? only if there are many rows which are connecting to crystal report..there is one search button to see the report on datagridview using year..so when the more items are there in database correspond it year(say 2012)..my datagridview will show the above exception by filling the datgridview,when it tries to connect with crystal report,it shows error..see my code below
reportgridview.Rows.Add(invoiceno, date1, product, bookno, serialno, price, quantity, customername, customerphone, payment, checkno, checkdate, discount, total, totalamount)
cryform1.formcall(invoiceno, date1, customername, customerphone, product, bookno, serialno, price, quantity, discount, payment, checkno, checkdate, total, totalamount)
Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
t = ds1.Tables.Add("DataTable1")
t.Columns.Add("invoiceno", Type.GetType("System.Int32"))
t.Columns.Add("customer_name", Type.GetType("System.String"))
t.Columns.Add("customer_phonenumber", Type.GetType("System.Int32"))
t.Columns.Add("date", Type.GetType("System.String"))
t.Columns.Add("product_item", Type.GetType("System.String"))
t.Columns.Add("bookno", Type.GetType("System.Int32"))
t.Columns.Add("serialno", Type.GetType("System.Int32"))
t.Columns.Add("price", Type.GetType("System.Single"))
t.Columns.Add("quantity", Type.GetType("System.Int32"))
t.Columns.Add("discount", Type.GetType("System.Int32"))
t.Columns.Add("paymentby", Type.GetType("System.String"))
t.Columns.Add("checkno", Type.GetType("System.Int32"))
t.Columns.Add("checkdate", Type.GetType(" System.String"))
t.Columns.Add("total", Type.GetType("System.Single"))
t.Columns.Add("totalamount", Type.GetType("System.Single"))
End Sub
Sub formcall(ByVal invoiceno As Integer, ByVal date1 As Date, ByVal customername As String, ByVal customerphone As Integer, ByVal product As String, ByVal bookno As Integer, ByVal serialno As Integer, ByVal price As Single, ByVal quantity As Integer, ByVal discount As Integer, ByVal payment As String, ByVal checkno As Integer, ByVal checkdate As String, ByVal total As Single, ByVal totalamount As Single)
' This call is required by the designer.
If IsDate(checkdate) Then
CType(checkdate, Date).ToShortDateString()
End If
r = t.NewRow()
r("invoiceno") = invoiceno
r("customer_Name") = customername
r("customer_Phonenumber") = customerphone
r("date") = date1.ToShortDateString
r("product_item") = product
r("bookNo") = bookno
r("serialNo") = serialno
r("price") = price
r("quantity") = quantity
r("discount") = discount
r("paymentby") = payment
r("checkno") = checkno
r("checkdate") = checkdate
r("total") = total
r("totalamount") = totalamount
t.Rows.Add(r)
Dim objRpt As New CrystalReport2
/*The error is showing here only if rows are more,now there are 117 rows in database contained more than */
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|