I have the following code snippet that sets a date range parameter incorrectly.
(The CR examples do not go this deep. I've looked.)
I get no errors, but if I use a Selection Formula of {TimeSheet.Work_Date} in {?Date Range} then it [red]filters out [/red]all the records. If I remove the selection formula, the report [red]shows[/red] all the records. So I must be doing something wrong in my ASP code.
Here is a VBScript snippet from my ASP page:
This results in the following:
Parameter [Date Range] = [10/30/2003-10/31/2003] ValueType=10 which is crDateField
525 Records read.
0 records selected.
Take care,
--Shaun Merrill
Seattle, WA
(The CR examples do not go this deep. I've looked.)
I get no errors, but if I use a Selection Formula of {TimeSheet.Work_Date} in {?Date Range} then it [red]filters out [/red]all the records. If I remove the selection formula, the report [red]shows[/red] all the records. So I must be doing something wrong in my ASP code.
Here is a VBScript snippet from my ASP page:
Code:
'Using CRAXDRT.DLL:Crystal Reports 8.5 ActiveX
' Designer Run Time Library
WITH oRpt.Parameterfields.Item(2)
' This gets a ParameterFieldDefinition object
SELECT CASE .DiscreteOrRangeKind
CASE crRangeValue
.EnableRangeLimit = TRUE
.MaximumValue = CDate("10/30/2003")
.MinimumValue = CDate("10/31/2003")
END SELECT
Response.Write "Parameter [" _
& .ParameterFieldName _
& "] = [" _
& .MinimumValue & "-" _
& .MaximumValue _
& "], ValueType=" _
& .ValueType
END WITH
'LOG IN TO EACH TABLE IN THE REPORT:
for each T in oRpt.Database.Tables
T.SetLogOnInfo _
sServer, sDatabase, sUserID, sPassword
If NOT T.TestConnectivity then
Response.Write "Connectivity error to table " _
& T.Name & "<br/>"
Set oRpt = nothing
Set oApp = nothing
Session.Abandon
Response.End
end if
next
set T = Nothing
'READ THE RECORDS:
call oRpt.ReadRecords()
Response.Write _
oRpt.PrintingStatus.NumberOfRecordRead _
& " records read.<br/>"
Response.Write _
oRpt.PrintingStatus.NumberOfRecordSelected _
& " records selected.<br/>"
This results in the following:
Parameter [Date Range] = [10/30/2003-10/31/2003] ValueType=10 which is crDateField
525 Records read.
0 records selected.
Take care,
--Shaun Merrill
Seattle, WA