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
| protected void Page_Load(object sender, EventArgs e)
{
String guid = Request["Guid"]; // j'arrive a recupérer le guid
showReport(guid);
}
private void showReport(string guid)
{
rvBVD.Reset();
DataTable dt = GetData(guid);
ReportDataSource rds = new ReportDataSource("DS_BVD", dt);
rvBVD.LocalReport.DataSources.Add(rds);
rvBVD.LocalReport.ReportPath = "Reports\\BVD.rdlc";
ReportParameter[] rptParms = new ReportParameter[]{
new ReportParameter("ReportParameterGuid", guid)
};
rvBVD.LocalReport.SetParameters(rptParms);
rvBVD.LocalReport.Refresh();
}
private DataTable GetData(string g)
{
DataTable dt = new DataTable();
SqlCommand MyCmd = new SqlCommand("RPT_EditionBVD", connection);
MyCmd.CommandType = CommandType.StoredProcedure;
MyCmd.Parameters.Add("@Guid", SqlDbType.VarChar).Value = g;
SqlDataAdapter adp = new SqlDataAdapter(MyCmd);
adp.Fill(dt);
return dt;
} |
Partager