예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //string relatorio = "Rel_Adesao_Nosso_Plano";
                string relatorio = Request.QueryString["Relatorio_nome"];
                if (!String.IsNullOrEmpty(relatorio))
                {
                    switch (relatorio)
                    {
                    case "TXT_PEFIN_SERASA":
                        table.Visible                = false;
                        btnRelatorio.Visible         = false;
                        btnTxtSerasa.Visible         = true;
                        btnConsultarRemessas.Visible = true;
                        //ListaRemessas();
                        break;

                    default:
                        break;
                    }

                    Relatorio res = rel.Listar(relatorio);
                    Session["ObjRelatorio"] = res;
                    GeraHtml(res);
                }
                else
                {
                    Response.Redirect("index.aspx");
                }
            }
        }
예제 #2
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.");
            }
        }