Esempio n. 1
0
        private void ExportarExcel(Boolean bZIP)
        {
            //this.UCUCConfirmaExportarInscritas1.ExportarExcel(this.chkZip.Checked);

            grdCanditadaEstadual.DataSource = ListaGrid;
            grdCanditadaEstadual.DataBind();

            this.HddnTipoArquivo.Value  = "xls";
            this.divUserControl.Visible = true;

            ViewState["NomeArquivo"] = "Ranking_Candidatas_" + DateTime.Now.Ticks;
            String nome     = ObjectUtils.ToString(ViewState["NomeArquivo"]);
            String extensao = "xls";

            Export(this.grdCanditadaEstadual, nome, extensao);

            System.Threading.Thread.Sleep(5000);

            if (bZIP)
            {
                this.compactaArquivo(GetMapPathFull(PathDownloadInscritas), nome, extensao);
                extensao = "zip";
            }

            //   URL = this.Request.Url.ToString().Substring(0, this.Request.Url.ToString().IndexOf("//") + 2) + this.Request.Url.Authority + "/" + PathDownloadInscritas.Replace("\\", "") + "/" + nome + "." + extensao;

            //NovaJanela(this.Page, this.Request.Url.ToString().Substring(0, this.Request.Url.ToString().IndexOf("//") + 2) + this.Request.Url.Authority + "/" + PathDownloadInscritas.Replace("\\", "") + "/" + nome + "." + extensao);

            String valor = "window.open('" + this.Request.Url.ToString().Substring(0, this.Request.Url.ToString().IndexOf("//") + 2) + this.Request.Url.Authority + "/" + PathDownloadInscritas.Replace("\\", "") + "/" + nome + "." + extensao + "');";

            this.ImgBttnExportar.Attributes.Add("onclick", valor);
        }
Esempio n. 2
0
        private void ExportarOpenDocument()
        {
            //this.UCUCConfirmaExportarInscritas1.ExportarOpenDocument(this.chkZip.Checked);


            grdCanditadaEstadual.DataSource = ListaGrid;
            grdCanditadaEstadual.DataBind();

            this.HddnTipoArquivo.Value  = "ods";
            this.divUserControl.Visible = true;

            if (int.Parse(Request["TipoEtapaId"]) == 6)
            {
                ViewState["NomeArquivo"] = "Ranking_PreClassificadas_" + DateTime.Now.Ticks;
            }
            else if (int.Parse(Request["TipoEtapaId"]) == 7)
            {
                ViewState["NomeArquivo"] = "Ranking_Fase4_" + DateTime.Now.Ticks;
            }

            String nome     = ObjectUtils.ToString(ViewState["NomeArquivo"]);
            String extensao = "ods";

            Export(this.grdCanditadaEstadual, nome, extensao);

            this.compactaArquivo(GetMapPathFull(PathDownloadInscritas), nome, extensao);
            extensao = "zip";

            String valor = "window.open('" + this.Request.Url.ToString().Substring(0, this.Request.Url.ToString().IndexOf("//") + 2) + this.Request.Url.Authority + "/" + PathDownloadInscritas.Replace("\\", "") + "/" + nome + "." + extensao + "');";

            this.ImgBttnExportar.Attributes.Add("onclick", valor);
        }
Esempio n. 3
0
        public void ExportarOpenDocument(bool compactado)
        {
            this.Clear();
            this.HddnTipoArquivo.Value  = "ods";
            this.divUserControl.Visible = true;

            ViewState["NomeArquivo"] = "Inscritas_" + DateTime.Now.Ticks;
            String nome     = ObjectUtils.ToString(ViewState["NomeArquivo"]);
            String extensao = "ods";

            Export(this.grdEmpresasExport, nome, extensao);

            if (compactado)
            {
                this.compactaArquivo(GetMapPathFull(PathDownloadInscritas), nome, extensao);
                extensao = "zip";
            }

            String valor = "window.open('" + this.Request.Url.ToString().Substring(0, this.Request.Url.ToString().IndexOf("//") + 2) + this.Request.Url.Authority + "/" + PathDownloadInscritas.Replace("\\", "") + "/" + nome + "." + extensao + "');";

            this.ImgBttnExportar.Attributes.Add("onclick", valor);
        }