Exemple #1
0
 protected void btn_ShowReport_Click(object sender, EventArgs e)
 {
     img_ExportToExcel1.Visible = false;
     if (ddl_Term.SelectedValue == "0")
     {
         RadWindowManager1.RadAlert("لطفا ترم را انتخاب کنید", 0, 100, "پیام", "");
     }
     else
     {
         if (txt_did.Text == string.Empty)
         {
             txt_did.Text = "0";
         }
         if (txt_CodeOstad.Text == string.Empty)
         {
             txt_CodeOstad.Text = "0";
         }
         System.Data.DataTable dt = FRB.GetAcceptMark(ddl_Term.SelectedValue, int.Parse(txt_did.Text), int.Parse(txt_CodeOstad.Text), Convert.ToInt32(ddlDanesh.SelectedValue));
         if (dt.Rows.Count == 0)
         {
             RadWindowManager1.RadAlert("رکوردی وجود ندارد", 100, 0, "پیام", "");
         }
         else
         {
             //Report
             img_ExportToExcel1.Visible = true;
             StiWebViewer1.Visible      = true;
             this.StiWebViewer1.ResetReport();
             StiReport rpt = new StiReport();
             rpt.Load(Server.MapPath("../Report/ReportFinal.mrt"));
             rpt.ReportCacheMode = StiReportCacheMode.On;
             rpt.Dictionary.Databases.Clear();
             rpt.Dictionary.Databases.Add(new StiSqlDatabase("Connection1", CB.ReportConnection.ToString()));
             rpt.Compile();
             rpt.CompiledReport.DataSources["[Faculty].[SP_ReportAcceptMark]"].Parameters["@Term"].ParameterValue      = ddl_Term.SelectedValue;
             rpt.CompiledReport.DataSources["[Faculty].[SP_ReportAcceptMark]"].Parameters["@CodeOstad"].ParameterValue = int.Parse(txt_CodeOstad.Text);
             rpt.CompiledReport.DataSources["[Faculty].[SP_ReportAcceptMark]"].Parameters["@Did"].ParameterValue       = int.Parse(txt_did.Text);
             rpt.CompiledReport.DataSources["[Faculty].[SP_ReportAcceptMark]"].Parameters["@daneshID"].ParameterValue  = int.Parse(ddlDanesh.SelectedValue);
             rpt.RegData(dt);
             //rpt.Dictionary.Synchronize();
             //rpt.Show();
             StiWebViewer1.Report  = rpt;
             StiWebViewer1.Visible = true;
         }
         if (txt_did.Text == "0")
         {
             txt_did.Text = string.Empty;
         }
         if (txt_CodeOstad.Text == "0")
         {
             txt_CodeOstad.Text = string.Empty;
         }
     }
 }