Help Regarding CrystalReports

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2006
Posts: 24
Reputation: sravankolla is an unknown quantity at this point 
Solved Threads: 0
sravankolla sravankolla is offline Offline
Newbie Poster

Help Regarding CrystalReports

 
0
  #1
Jun 22nd, 2006
Hi all,
I am working with a project which includes Crystal Reports in Vb.Net and SQL Server2000 as Back end.

The code in button click is
  1. str5 = "D:\AttendanceReport.rpt"
  2. If Not IO.File.Exists(str5) Then
  3. Throw (New Exception("Unable to locate report file:" & vbCrLf & str5))
  4. End If
  5. str6 = "SELECT * FROM attendance WHERE attendance.dates ='" & str & " ' and Empid in ( Select Empid from EmployeeDetails where DeptId in (Select Deptid from departments where deptname='" & Convert.ToString(cbxDept.SelectedItem) & "' ))"
  6.  
  7. MsgBox(str6)
  8. da5 = New OleDbDataAdapter(str6, sDbConnection)
  9. da5.Fill(ds5, "Attendance")
  10. rst.SetDataSource(ds5)
  11. Dim myReportDocument As ReportDocument
  12. myReportDocument = New ReportDocument
  13. myReportDocument.Load(str5)
  14. myReportDocument.SetDataSource(ds5)
  15. 'Binding report with CrystalReportViewer
  16. CRViewer.ReportSource = myReportDocument
  17. CRViewer.DataBind()

I am getting an error as

'DataBind' is not a member of 'CrystalDecisions.Windows.Forms.CrystalReportViewer'.

I can't understand why the error is Coming
Please Help me

Thanks in advance

Sravan...
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 22
Reputation: Amit007 is an unknown quantity at this point 
Solved Threads: 0
Amit007 Amit007 is offline Offline
Newbie Poster

Re: Help Regarding CrystalReports

 
0
  #2
Aug 15th, 2006
I can help u. But u will have to mail me at coolamit0072003@hotmail.com . Mention this error in mail
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 57
Reputation: Exelio is an unknown quantity at this point 
Solved Threads: 0
Exelio Exelio is offline Offline
Junior Poster in Training

Re: Help Regarding CrystalReports

 
0
  #3
Aug 16th, 2006
Hi sravan,

When you are using crystal reports in vb.net,there is no method databind available.It is enough if you set the reportsource property to the correct crystal report.

Here is your code.
str5 = "D:\AttendanceReport.rpt"
If Not IO.File.Exists(str5) Then
Throw (New Exception("Unable to locate report file:" & vbCrLf & str5))
End If
str6 = "SELECT * FROM attendance WHERE attendance.dates ='" & str & " ' and Empid in ( Select Empid from EmployeeDetails where DeptId in (Select Deptid from departments where deptname='" & Convert.ToString(cbxDept.SelectedItem) & "' ))"

MsgBox(str6)
da5 = New OleDbDataAdapter(str6, sDbConnection)
da5.Fill(ds5, "Attendance")
rst.SetDataSource(ds5)
Dim myReportDocument As ReportDocument
myReportDocument = New ReportDocument
myReportDocument.Load(str5)
myReportDocument.SetDataSource(ds5)
'Binding report with CrystalReportViewer
CRViewer.ReportSource = myReportDocument


Hope this helps

Regards

Exelio
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 144
Reputation: sierrainfo is an unknown quantity at this point 
Solved Threads: 9
sierrainfo sierrainfo is offline Offline
Junior Poster

Re: Help Regarding CrystalReports

 
0
  #4
Dec 3rd, 2008
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC