Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Engine Error

Status
Not open for further replies.

tonioJ

Programmer
Oct 7, 2002
90
PH
I am getting a "Query Engine Error" when showing up my report in CRViewer. Why is this happening? Any solution or suggestion so that I can solve the problem? I am trying to figure out this problem for about 3 days now. Other report works well with dataset being passed using plain "SELECT * FROM TABLENAME where ....". but in this case i am using a stored procedure to return a result in a query in a dataset. Please help and thank you in advance.


Private Sub PrintReport()
Dim crViewerFrm As New crptViews
Dim oRpt As CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim daReport As SqlClient.SqlDataAdapter
Dim dsReport As New DataSet

If (Len(Trim(txtPaymentNo.Text)) <> 0) And IsNumeric(txtPaymentNo.Text) Then
'--- get the records
strSQL = "sp__pcs_PrintSelectedPayment '" & Trim(CoCode) & "'," & CInt(txtPaymentNo.Text)

daReport = New SqlClient.SqlDataAdapter(strSQL, dbcnn)
dsReport.Clear()
daReport.Fill(dsReport, strSQL)

oRpt = New CrystalDecisions.CrystalReports.Engine.ReportDocument
oRpt.Load("D:\\AMJ\\PCS.Net\\ProjectCostingSystem\\crpt\\cPayment.rpt")


If dsReport.Tables(0).Rows.Count <> 0 Then
oRpt.Database.Tables(0).SetDataSource(dsReport)
crViewerFrm.CrystalReportViewer1.ReportSource = oRpt
crViewerFrm.Show() <--- ERROR IN THIS LINE
Else
MsgBox("No record to print!", MsgBoxStyle.Exclamation, msgboxTitle)
End If
End If

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top