Originally posted by JohnT
How are you entering your to and from date ? It sounds like you want command.date >= from date and command.date <= to date. In your formula, what is the value of "My Parameter" ?
Page1:From Date: TXTBOX1
To Date: TXTBOX2
BTNSUBMIT-CLICK
{
server.transfer("page2.aspx");
}
Page 2:
if (PreviousPage != null)
{
TextBox txt1 = PreviousPage.FindControl("TXTBOX1") as TextBox;
TextBox txt2 = PreviousPage.FindControl("TXTBOX2") as TextBox;
if (txt1.Text.Length != 0 && txt2.Text.Length != 0)
{
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("MyReport.rpt");
ParameterFieldDefinitions crParameterFieldDefinitions;
ParameterFieldDefinition crParameterFieldDefinition;
ParameterValues crParameterValues = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue = new
ParameterDiscreteValue();
crParameterDiscreteValue.Value = txt1.Text + txt2.Text;
crParameterFieldDefinitions =
cryRpt.DataDefinition.ParameterFields;
crParameterFieldDefinition =
crParameterFieldDefinitions["MyParameter"];
crParameterValues = crParameterFieldDefinition.CurrentValues;
crParameterValues.Clear();
crParameterValues.Add(crParameterDiscreteValue);
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
CrystalReportViewer1.ReportSource = cryRpt;
}
}
Formula In Formula Editor:
{Command.Date} >= {?MyParameter} and {Command.Date} <= {?MyParameter}