How to use the record selection formula in CR9 programatically using vb.net? I have a combo box that displays the date. If I select date, I can generate a report based on the selected date. Thanks in advance
Record Selection in Crystal Reports 9 using VB.net
Collapse
X
-
Hi Veena,
I tried to used this in my record selection, however, I received an error, "The ) is missing" when I checked it, any part here that I missed? thnks.
VB code:
CrystalReportVi ewer1.Selection Formula = "{vTITO_Rpt.Wor kDate} In Date (" & Format(cmbxDate From.Text, "YYYY,MM,DD ") & ") To Date (" & Format(cmbxDate To.Text, "YYYY,MM,DD ") & ")"
RegardsComment
-
Hi,
For CR9, it .RecordSelectio nFormula.
Looks like, you have not declared the Report Object..
What code are you using to display the report...?
Check this :
m_Report.Select ionFormula = "{vTITO_Rpt.Wor kDate} In Date (" & Format(cmbxDate From.Text, "YYYY,MM,DD ") & ") To Date (" & Format(cmbxDate To.Text, "YYYY,MM,DD ") & ")"
Regards
VeenaComment
-
The "m_report" here you use is the Crystal Report viewer, right? I'm using CR9, tried to use the .RecordSelectio nFormula, but it's not working. I tried to use the previous post you have here but still to no avail. What do I miss here? ThanksLast edited by Killer42; Nov 26 '07, 08:57 AM.Comment
-
Hi Veena,
Here is my code I used, I can't find what's seems to the error here, but everytime I used it, I encountered the error "The ) missing" . Thanks in advance
CrystalReportVi ewer1.ReportSou rce = New ReportName CrystalReportVi ewer1.ReportSou rce = ReportDocument
CrystalReportVi ewer1.Selection Formula = "{vTITO_Rpt.Wor kDate} In Date (" & Format(cmbxDate From.Text, "YYYY,MM,DD ") & ") To Date (" & Format(cmbxDate To.Text, "YYYY,MM,DD ") & ")"
CrystalReportVi ewer1.Show()
RegardsComment
-
HI Veena,
I tried to see check it on the crystal report "show formula" then I tried to used this in my code using the below syntax, it worked well. However, as you can see it was not based on the input on the combo box. It was manually inputted on the selection expert. Thanks
mySelectFormula = "{vTITO_Rpt.Emp No} In Date (2007, 10, 08) to DateTime (2007, 10, 09)"Comment
Comment