private void CarregaTela()
        {
            switch (optTipo.SelectedValue)
            {
            case "1":
            case "3":
                if (InicializaRelatorio(txtCodEmpresa.Text, txtCodMatricula.Text, "01/01/2015"))
                {
                    ReportCrystal.VisualizaRelatorio();
                    grdExtratoPrevidenciario.Visible = false;
                    ifExtratoPrevSysDocs.Visible     = false;
                    ReportCrystal.Visible            = true;
                }
                ;
                break;

            case "2":
                extratoPrevidenciarioBLL CredReeBLL = new extratoPrevidenciarioBLL();
                grdExtratoPrevidenciario.DataSource = CredReeBLL.ListaPeriodos(int.Parse(txtCodEmpresa.Text), int.Parse(txtCodMatricula.Text), DateTime.Parse(txtDtIni.Text), DateTime.Parse(txtDtFim.Text));
                grdExtratoPrevidenciario.DataBind();
                grdExtratoPrevidenciario.Visible = true;
                ifExtratoPrevSysDocs.Visible     = false;
                ReportCrystal.Visible            = false;
                break;

            default:
                CarregarExtratoPrevSysDocs();
                grdExtratoPrevidenciario.Visible = false;
                ifExtratoPrevSysDocs.Visible     = true;
                break;
            }
        }
Exemplo n.º 2
0
        //protected void btnConsultar_Click(object sender, EventArgs e)
        //{
        //    string message = ValidaCampos();
        //    if (string.IsNullOrEmpty(message))
        //    {
        //        ViewState["Parametros"] = txtdtIni.Text + "|" + txtdtFin.Text;
        //        CarregaGrid("grdImportacao", new MovDiarioBLL().BuscaImportacao(txtdtIni.Text, txtdtFin.Text), grdImportacao);
        //    }
        //    else
        //        MostraMensagemTelaUpdatePanel(upSys, "Atenção!\\n" + message);
        //}

        protected void btnRelatorio_Click(object sender, EventArgs e)
        {
            if (InicializaRelatorio())
            {
                ReportCrystal.VisualizaRelatorio();
                //bool alerta = false;
                //Session[relatorio_nome] = relatorio;
                //AbrirNovaAba(this.Page, "RelatorioWeb.aspx?Relatorio_nome=" + relatorio_nome + "&PromptParam=false&Popup=true" + (alerta ? "&Alert=true" : ""), relatorio_nome);
            }
        }
Exemplo n.º 3
0
 protected void btnRelatorio_Click(object sender, EventArgs e)
 {
     try
     {
         Resultado res = ValidaCampos(relatorio);
         if (res.Ok)
         {
             ReportCrystal.VisualizaRelatorio();
         }
         else
         {
             throw new Exception(res.Mensagem);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + ex.Message + "');", true);
     }
 }
Exemplo n.º 4
0
        protected void Page_Init(object sender, EventArgs e)
        {
            string relatorio_nome = Request.QueryString["Relatorio_nome"];

            if (!String.IsNullOrEmpty(relatorio_nome))
            {
                if (Request.QueryString["Alert"] != null)
                {
                    exibe_alerta_verifica = Request.QueryString["Alert"];
                }
                if (Request.QueryString["PromptParam"] != null)
                {
                    PromptParam = Boolean.Parse(Request.QueryString["PromptParam"]);
                }
                btnRelatorio.Visible = PromptParam;
                tabelaPagina.Visible = PromptParam;
                //Relatorio res = null;
                ReportCrystal.RelatorioID = relatorio_nome;
                if (Session[relatorio_nome] != null && (IsPostBack || !PromptParam))
                {
                    relatorio = (Relatorio)Session[relatorio_nome];
                    //ReportCrystal.GeraRelatorio();
                    ReportCrystal.VisualizaRelatorio();
                }
                else
                {
                    relatorio = rel.Listar(relatorio_nome);
                    Session[relatorio_nome] = relatorio;
                    NomeRelatorio.Text      = relatorio.titulo;
                    GeraHtml(table, relatorio);
                }
                NomeRelatorio.Text = "Relatorio " + relatorio.titulo;
            }
            else
            {
                MostraMensagemTela(this.Page, "Atenção \\n\\n Para acessar o relatório é necessário estar logado.");
            }
        }