1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
protected void Recherche_Click(object sender, EventArgs e)
{
ReportDocument reportDocument = new ReportDocument();
string reportPath = Server.MapPath("~/Etats/EtatsAgents/CrystalReport1.rpt");
reportDocument.FileName = Server.MapPath("~/Etats/EtatsAgents/CrystalReport1.rpt");
ParameterField paramField = new ParameterField();
ParameterFields paramFields = new ParameterFields();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
paramField.Name = "AgentMatricule";
paramDiscreteValue.Value = txtMatriculeAgent.Text.Trim();
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
CrViewer.ParameterFieldInfo = paramFields;
CrViewer.ReportSource = reportDocument;
reportDocument.Load(reportPath);
reportDocument.SetDatabaseLogon("sa", "Doumb", "MAMADOU-PC\\MSSQLSERVER2008", "Enre_Pax");
CrViewer.RefreshReport();
CrViewer.Zoom(85);
} |
Partager