| | |
Help Regarding CrystalReports
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Apr 2006
Posts: 24
Reputation:
Solved Threads: 0
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
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
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
VB.NET Syntax (Toggle Plain Text)
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 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...
•
•
Join Date: Aug 2006
Posts: 22
Reputation:
Solved Threads: 0
I can help u. But u will have to mail me at coolamit0072003@hotmail.com . Mention this error in mail
•
•
Join Date: Aug 2006
Posts: 57
Reputation:
Solved Threads: 0
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
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
![]() |
Similar Threads
- Problem with Crystal Report in ASP.NET (ASP.NET)
- crystal report (VB.NET)
- CrystalReports.Engine: Load report failed (ASP.NET)
- Creating dynamic Reports (ASP.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- how do i use selectionformula using 2 fields (Visual Basic 4 / 5 / 6)
- Error While Declaring Crytal Report Object (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: Programming keyboard keys in vb.net
- Next Thread: Encrypt File using User Supplied Password
| Thread Tools | Search this Thread |
"crystal .net .net2005 .net2008 2008 access add application array assignment basic beginner box browser button buttons click code combo convert cpu cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationthesis dissertationtopic dosconsolevb.net editvb.net exists fade filter firewall forms html image images input isnumericfuntioncall listview math mobile module mssqlbackend mysql navigate number opacity open panel picturebox picturebox2 port print printing printpreview record regex reports" reuse right-to-left savedialog serial settings shutdown socket sqldatbase sqlserver storedprocedure string temp temperature textbox timer timespan transparency txttoxmlconverter useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vbnet vista visual visualbasic.net visualstudio.net web winforms wpf wrapingcode xml year





