Beispiel #1
0
 protected void btn_ShowInfo_Click(object sender, EventArgs e)
 {
     img_ExportToExcel1.Visible = false;
     img_ExportToExcel2.Visible = false;
     if (ddl_Term.SelectedValue == null || ddl_Term.SelectedValue == "0")
     {
         RadWindowManager1.RadAlert("لطفا ترم را انتخاب نمایید", 0, 100, "پیام", "");
     }
     else if (ddl_Degree.SelectedValue == null || ddl_Degree.SelectedValue == "0")
     {
         RadWindowManager1.RadAlert("لطفا مقطع را انتخاب نمایید", 0, 100, "پیام", "");
     }
     else
     {
         if (rdb_Mardudi.Checked == true)
         {
             PSD.Percent = txt_Percent.Text;
             if (txt_Percent.Text == null || txt_Percent.Text == "")
             {
                 txt_Percent.Text = "0";
             }
             dtResault = FRB.GetStudentsProbation(ddl_Term.SelectedValue, int.Parse(ddl_Degree.SelectedValue), int.Parse(txt_Percent.Text));
             if (dtResault.Rows.Count == 0)
             {
                 RadWindowManager1.RadAlert("رکوردی وجود ندارد", 0, 100, "پیام", "");
             }
             else
             {
                 //Report
                 img_ExportToExcel1.Visible = true;
                 this.StiWebViewer1.ResetReport();
                 StiWebViewer1.Visible = true;
                 StiReport rpt = new StiReport();
                 rpt.Load(Server.MapPath("../Report/ReportStudentProbation.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_StudentsProbation]"].Parameters["@Term"].ParameterValue    = ddl_Term.SelectedValue;
                 rpt.CompiledReport.DataSources["[Faculty].[SP_StudentsProbation]"].Parameters["@Degree"].ParameterValue  = int.Parse(ddl_Degree.SelectedValue);
                 rpt.CompiledReport.DataSources["[Faculty].[SP_StudentsProbation]"].Parameters["@Percent"].ParameterValue = int.Parse(txt_Percent.Text);
                 rpt.RegData(dtResault);
                 rpt.Dictionary.Synchronize();
                 //rpt.Show();
                 StiWebViewer1.Report  = rpt;
                 StiWebViewer1.Visible = true;
                 //rpt.Print(true);
             }
         }
         else
         {
             PSD.Percent = txt_PercentGhabul.Text;
             if (txt_PercentGhabul.Text == null || txt_PercentGhabul.Text == "")
             {
                 txt_PercentGhabul.Text = "0";
             }
             dtResault = FRB.GetStudentsProbationAcceptance(ddl_Term.SelectedValue, int.Parse(ddl_Degree.SelectedValue), int.Parse(txt_PercentGhabul.Text));
             if (dtResault.Rows.Count == 0)
             {
                 RadWindowManager1.RadAlert("رکوردی وجود ندارد", 0, 100, "پیام", "");
             }
             else
             {
                 //Report
                 img_ExportToExcel2.Visible = true;
                 this.StiWebViewer1.ResetReport();
                 StiWebViewer1.Visible = true;
                 StiReport rpt = new StiReport();
                 rpt.Load(Server.MapPath("../Report/ReportStudentProbationAcceptance.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_StudentsProbationAcceptance]"].Parameters["@Term"].ParameterValue    = ddl_Term.SelectedValue;
                 rpt.CompiledReport.DataSources["[Faculty].[SP_StudentsProbationAcceptance]"].Parameters["@Degree"].ParameterValue  = int.Parse(ddl_Degree.SelectedValue);
                 rpt.CompiledReport.DataSources["[Faculty].[SP_StudentsProbationAcceptance]"].Parameters["@Percent"].ParameterValue = int.Parse(txt_PercentGhabul.Text);
                 rpt.RegData(dtResault);
                 rpt.Dictionary.Synchronize();
                 //rpt.Show();
                 StiWebViewer1.Report  = rpt;
                 StiWebViewer1.Visible = true;
                 //rpt.Print(true);
             }
         }
     }
 }