private void cmdPublish_ServerClick(object sender, EventArgs e)
        {
            if (ValidateInput() == false)
            {
                return;
            }
            UpdateReportDesignView();
            this.SaveDesignView(designView);

            string strFileName = "", strRptFile = "";

            if (string.IsNullOrEmpty(this.designView.DesignMain.ReportFileName) == true)
            {
                strFileName = this.designView.UploadFileName;
                strFileName = strFileName.Substring(strFileName.LastIndexOf("\\") + 1);
                strFileName = Server.MapPath("../ReportFiles") + "\\" + strFileName;

                strRptFile = strFileName.Substring(Server.MapPath("../").Length);
                this.designView.DesignMain.ReportFileName = strRptFile;
            }

            ReportViewFacade rptFacade = new ReportViewFacade(this.DataProvider);

            ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider) this.DataProvider).PersistBroker.OpenConnection();
            this.DataProvider.BeginTransaction();
            try
            {
                rptFacade.PublishUploadedReportFile(this.designView, strFileName, this.GetUserCode());

                this.DataProvider.CommitTransaction();
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                throw ex;
            }
            finally
            {
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider) this.DataProvider).PersistBroker.CloseConnection();
            }

            string[] strVal = new string[this.designView.ReportSecurity.Length];
            for (int i = 0; i < this.designView.ReportSecurity.Length; i++)
            {
                ////Modified by allen on 20081104 for change security: functiongroup
                //strVal[i] = this.designView.ReportSecurity[i].UserGroupCode;
                strVal[i] = this.designView.ReportSecurity[i].FunctionGroupCode;
                ////End Modified by allen on 20081104 for change security: functiongroup
            }
            this.rptSecuritySelect.SetSelectedItem(strVal);

            this.Session["PublishedReportId"] = this.designView.ReportID;

            string alertInfo =
                string.Format("<script language=javascript>alert('{0}');window.top.location.reload();</script>", this.languageComponent1.GetString("$ReportDesign_Publish_Success"));

            if (!this.ClientScript.IsClientScriptBlockRegistered("SaveSuccess"))
            {
                this.ClientScript.RegisterClientScriptBlock(typeof(string), "SaveSuccess", alertInfo);
            }
            this.cmdPublish.Disabled = true;
            this.cmdPublish.Attributes.Add("disabled", "disabled");
        }