protected void btn_ShowReport_Click(object sender, EventArgs e)
 {
     img_ExportToExcel1.Visible = false;
     if (ddl_Term.SelectedValue == null || ddl_Term.SelectedValue == "0")
     {
         RadWindowManager1.RadAlert("لطفا ترم را انتخاب نمایید", 0, 100, "پیام ", "");
     }
     else
     {
         if (ddl_Daneshkade.SelectedValue == null)
         {
             ddl_Daneshkade.SelectedValue = "0";
         }
         if (ddl_Departman.SelectedValue == null)
         {
             ddl_Departman.SelectedValue = "0";
         }
         if (ddl_Cooperation.SelectedValue == null)
         {
             ddl_Cooperation.SelectedValue = "0";
         }
         if (ddl_Term.SelectedValue == null)
         {
             ddl_Term.SelectedValue = "0";
         }
         if (ddl_Field.SelectedValue == null)
         {
             ddl_Field.SelectedValue = "0";
         }
         if (txt_CodeOstad.Text == string.Empty)
         {
             txt_CodeOstad.Text = "0";
         }
         dtResault = FRB.GetListPayProf(ddl_Term.SelectedValue, int.Parse(ddl_Daneshkade.SelectedValue), int.Parse(ddl_Field.SelectedValue), int.Parse(ddl_Departman.SelectedValue), int.Parse(ddl_Cooperation.SelectedValue), int.Parse(txt_CodeOstad.Text), int.Parse(txt_Zarib.Text));
         if (dtResault.Rows.Count == 0)
         {
             RadWindowManager1.RadAlert("رکوردی وجود ندارد", 0, 100, "پیام", "");
         }
         else
         {
             img_ExportToExcel1.Visible = true;
             this.StiWebViewer1.ResetReport();
             StiWebViewer1.Visible = true;
             StiReport rpt = new StiReport();
             rpt.Load(Server.MapPath("../Report/ReportListPayProf.mrt"));
             rpt.ReportCacheMode = StiReportCacheMode.On;
             StiOptions.Engine.ReportCache.AmountOfProcessedPagesForStartGCCollect = 20000; // default - 20
             StiOptions.Engine.ReportCache.AmountOfQuickAccessPages = 10000;                // default - 50
             rpt.Dictionary.Databases.Clear();
             rpt.Dictionary.Databases.Add(new StiSqlDatabase("Connection1", CB.ReportConnection.ToString()));
             rpt.Compile();
             rpt.CompiledReport.DataSources["[Faculty].[SP_ListPayTuition]"].Parameters["@Term"].ParameterValue        = ddl_Term.SelectedValue;
             rpt.CompiledReport.DataSources["[Faculty].[SP_ListPayTuition]"].Parameters["@Daneshkade"].ParameterValue  = int.Parse(ddl_Daneshkade.SelectedValue);
             rpt.CompiledReport.DataSources["[Faculty].[SP_ListPayTuition]"].Parameters["@Field"].ParameterValue       = int.Parse(ddl_Field.SelectedValue);
             rpt.CompiledReport.DataSources["[Faculty].[SP_ListPayTuition]"].Parameters["@Departman"].ParameterValue   = int.Parse(ddl_Departman.SelectedValue);
             rpt.CompiledReport.DataSources["[Faculty].[SP_ListPayTuition]"].Parameters["@Cooperation"].ParameterValue = int.Parse(ddl_Cooperation.SelectedValue);
             rpt.CompiledReport.DataSources["[Faculty].[SP_ListPayTuition]"].Parameters["@CodeOstad"].ParameterValue   = int.Parse(txt_CodeOstad.Text);
             rpt.CompiledReport.DataSources["[Faculty].[SP_ListPayTuition]"].Parameters["@Zarib"].ParameterValue       = int.Parse(txt_Zarib.Text);
             //((StiSqlSource)rpt.Dictionary.DataSources["[Faculty].[SP_ConflictClassbyNumberClass]"]).CommandTimeout = 30000;
             rpt.RegData(dtResault);
             rpt.Render();
             StiWebViewer1.Report  = rpt;
             StiWebViewer1.Visible = true;
         }
     }
     if (txt_CodeOstad.Text == "0" || txt_CodeOstad.Text == "")
     {
         txt_CodeOstad.Text    = "";
         Session["code_ostad"] = null;;
     }
     //txt_CodeOstad.Text = "";
     Session["code_ostad"] = null;
 }