protected void btnRelatorio_Click(object sender, EventArgs e) { String retorno = String.Empty; try { retorno = new MMAA.Pedidos.Web.WS.Pedido().GerarRelatorio(System.Configuration.ConfigurationSettings.AppSettings["connString"], System.Configuration.ConfigurationSettings.AppSettings["Relatorio.Path"], System.Configuration.ConfigurationSettings.AppSettings["Relatorio.Template"]); ScriptManager.RegisterStartupScript(this, this.GetType(), "mensagem", retorno, true); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, this.GetType(), "mensagem", "alert('Ocorreu um erro ao gerar o relatório." + ex.Message.Replace("'", "").Replace((char)13, ' ').Replace((char)10, ' ') + "');", true); } }
protected void btnRelatorio_Click(object sender, EventArgs e) { String retorno = String.Empty; try { CarregaParametros(); if (ddlRelatorio.SelectedValue == "0") { retorno = new MMAA.Pedidos.Web.WS.Pedido().GerarRelatorioProcesso(System.Configuration.ConfigurationSettings.AppSettings["connString"], System.Configuration.ConfigurationSettings.AppSettings["Relatorio.Path"], System.Configuration.ConfigurationSettings.AppSettings["Relatorio.Template2"], objProcesso, 0); ScriptManager.RegisterStartupScript(this, this.GetType(), "mensagem", retorno, true); } else if (ddlRelatorio.SelectedValue == "1") { retorno = new MMAA.Pedidos.Web.WS.Pedido().GerarRelatorioProcessoCBD(System.Configuration.ConfigurationSettings.AppSettings["connString"], System.Configuration.ConfigurationSettings.AppSettings["Relatorio.Path"], System.Configuration.ConfigurationSettings.AppSettings["Relatorio.TemplateCBD"], objProcesso, 0); ScriptManager.RegisterStartupScript(this, this.GetType(), "mensagem", retorno, true); } else if (ddlRelatorio.SelectedValue == "2") //Relatório de CBD Juros outros Escritórios { retorno = new MMAA.Pedidos.Web.WS.Pedido().GerarRelatorioCBDJuros(System.Configuration.ConfigurationSettings.AppSettings["connString"], System.Configuration.ConfigurationSettings.AppSettings["Relatorio.Path"], System.Configuration.ConfigurationSettings.AppSettings["Relatorio.Template3"], objProcesso, 0, "SP_RELATORIO_CBD_JUROS"); ScriptManager.RegisterStartupScript(this, this.GetType(), "mensagem", retorno, true); } else if (ddlRelatorio.SelectedValue == "3")// Relatório de CBD Juros Mattos Filho { retorno = new MMAA.Pedidos.Web.WS.Pedido().GerarRelatorioCBDJuros(System.Configuration.ConfigurationSettings.AppSettings["connString"], System.Configuration.ConfigurationSettings.AppSettings["Relatorio.Path"], System.Configuration.ConfigurationSettings.AppSettings["Relatorio.Template3"], objProcesso, 0, "SP_RELATORIO_CBD_JUROS_MATTOS_FILHO"); ScriptManager.RegisterStartupScript(this, this.GetType(), "mensagem", retorno, true); } else if (ddlRelatorio.SelectedValue == "4")// Relatório CBD - PPI { retorno = new MMAA.Pedidos.Web.WS.Pedido().GerarRelatorioCBD_PPI(System.Configuration.ConfigurationSettings.AppSettings["connString"], System.Configuration.ConfigurationSettings.AppSettings["Relatorio.Path"], System.Configuration.ConfigurationSettings.AppSettings["Relatorio.TemplateCBD_PPI"], objProcesso, 0); ScriptManager.RegisterStartupScript(this, this.GetType(), "mensagem", retorno, true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, this.GetType(), "mensagem", "alert('Ocorreu um erro ao gerar o relatório." + ex.Message.Replace("'", "").Replace((char)13, ' ').Replace((char)10, ' ') + "');", true); } }