About Data in crystal report
Hello Everybody!
I am again have one problem. I never used crystal report viewer control to view. rather i was using crystal report activex control to display a report. But now i want to use crystal report viewer to display my report. for that I've added crystal report in my project and then i wrote following code in the load event of the form which contains the crystal report viewer. But when it is not displaying anything in the crystal report viewer control. I have used two forms :
1. First form accepts parameter for the reports. it accepts two dates :
start date and end date. In the click event of preview button i've opened form which contains crystal report viewer control. and in the load event of that form i've written following code :
VB Code:
Private Sub Form_Load()
Dim rsHoliday As New ADODB.Recordset
Dim ssql As String
Dim Report As CRAXDDRT.Report
Dim dStartDate As Date
Dim dEndDate As Date
dStartDate = frmHolidayListReport.dtpFrom.Value 'frmHolidayListReport is a from which takes parameter for the report
dEndDate = frmHolidayListReport.dtpTo.Value
'Dim report As New CRAXDDRT.report
ssql = "select * from tblHolidaySchedule"
rsHoliday.CursorLocation = adUseClient
rsHoliday.Open ssql, cn
Set Report = New rptHolidaySchedule
With Report
.DiscardSavedData
.RecordSelectionFormula = "{tblHolidaySchedule.StartDate}>=#" & dStartDate & "# and {tblHolidaySchedule.StartDate}<=#" & dEndDate & "#"
.EnableParameterPrompting = False
.ParameterFields(1).AddCurrentValue dStartDate
.ParameterFields(2).AddCurrentValue dEndDate
.Database.SetDataSource rsHoliday
End With
crHolidays.ReportSource = Report
' Do While crSummary.IsBusy
' DoEvents
' Loop
crHolidays.Zoom 100
End Sub
plz help me wht is the problem with this. I've still lots of reports to do. so plz help me ASAP.
thanks a lot for ur kind help.
Re: About Data in crystal report
Sorry I forgot to mention that I am using VB6,Access2003 and crystal report 8.5
Re: About Data in crystal report
is there anybody to help plz!!!!!!!!!!!!!!!