In CR, I have users select start date and end date and build query using this date range to populate a reporting table. What I like to do is display this start date and end date in report header. How can I do this? Thanks.
I am using CR 9. How can I display parameters in textbox or formula? Thanks.
I am doing following:
Case "Customer"
Dim crReportDocument As Customer
crReportDocument = New Customer
ApplyLogOnInfo(crReportDocument.Database)
ds = oReport.GetReport(strLetter, , strBeginDate, strEndDate)
With crReportDocument
.SetParameterValue("@startDate", strBeginDate)
.SetParameterValue("@endDate", strEndDate)
End With
crReportDocument.SetDataSource(ds)
CrystalReportViewer1.ReportSource = crReportDocument
Created StartDate and EndDate parameter fields in Field explorer and it works.
But the Enter Parameter dialog box pops up. How can the dialog box be avoided
and instead use the param that I pass?
Thanks.
I already gave you the formula for what you initially wanted.
Now you're asking for external code, it's unrelated to the original topic and you should start an additional post.
And you changed what you're using, the original post stated a date range, now you speak of two different parameters.
Please be spcific with your questions, and post meaningful technical information such as the software being used, not just which version of Crystal, but your development language/version. Why would a developer think that programming languages and the Crystal API used have nothing to do with the solution?
Thanks k, got it working with formula you provided.
' Create parameter objects
Dim myParams As ParameterFields = New ParameterFields
Dim myParam As ParameterField = New ParameterField
Dim myRangeValue As ParameterRangeValue = New ParameterRangeValue
' Set the ParameterFieldName to the name of the parameter created in the Field Explorer
myParam.ParameterFieldName = "DateRange"
' Add start date
myRangeValue.StartValue = strBeginDate
myRangeValue.EndValue = strEndDate
myParam.CurrentValues.Add(myRangeValue)
myParams.Add(myParam)
' Assign the params collection to the report viewer
CrystalReportViewer1.ParameterFieldInfo = myParams
CrystalReportViewer1.ReportSource = crReportDocument
CrystalReportViewer1.Visible = True
CrystalReportViewer1.Zoom(100)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.