Page1:Date de Gamme Formula
De Date: TXTBOX1 à ce jour: TXTBOX2
btnSubmit-CLIQUEZ { Server.Transfer ("page2.aspx"); }
Page 2:
if (! PrécédentePage = null) { TextBox txt1 = PreviousPage.FindControl ("TXTBOX1") comme zone de texte; TextBox txt2 = PreviousPage.FindControl ("TXTBOX2") en tant que 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 Dans l'Éditeur de formules: {? MyParameter} {?} MyParameter
{} Command.Date> = {et} Command.Date < =
Il fonctionne très bien Si le rapport est affiché pour une date unique. Pas pour la plage de dates.
Avez-vous des suggestions? Où je me trompe dans la formule/code ???