|
-
Feb 5th, 2006, 08:43 PM
#11
Junior Member
Re: making a parameter optional
I'm using .NET, but the code is quite familiar:
Don't use parameters. Try to manage at runtime the selection formula like the example
below:
string selectFormula;
oRpt = new ReportDocument();
oRpt.Load(Application.StartupPath.ToString() + "\\Reportes\\ListadoPagos.rpt");
oRpt.Refresh();
crystalReportViewer1.ReportSource = oRpt;
selectFormula = "{PAGOS.FechaPago} = DateTime('" + fechaDePago + "')";
crystalReportViewer1.SelectionFormula = selectFormula;
If you want to make it "optional" you can put the following sentence:
If Trim(txtLocation.Text) <> "" Then
selectFormula = "{TABLE1.Location} = '" + Trim(txtLocation.Text) + "'"
crystalReportViewer1.SelectionFormula = selectFormula;
End If
Try to adjust it to your report.
Regards,
Tribo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|