Ejemplo n.º 1
0
        protected void carga_excel(string sp_informe, string titulo)
        {
            string desde = string.Format("{0:yyyyMMdd}", DateTime.Now);
            string hasta = string.Format("{0:yyyyMMdd}", DateTime.Now);

            if (this.txt_desde.Text.Trim() != "")
            {
                desde = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_desde.Text.Trim()));
            }
            if (this.txt_hasta.Text.Trim() != "")
            {
                hasta = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_hasta.Text.Trim()));
            }
            int    sucursal     = 0;
            int    ciudad       = 0;
            int    id_solicitud = 0;
            int    id_familia   = 0;
            string id_codigo    = "0";

            int id_cliente = 0;

            if (this.dl_sucursal.SelectedValue.ToString() != "")
            {
                sucursal = Convert.ToInt16(this.dl_sucursal.SelectedValue);
            }
            if (this.dl_ciudad.SelectedValue.ToString() != "")
            {
                ciudad = Convert.ToInt16(this.dl_ciudad.SelectedValue);
            }
            if (this.dl_cliente.SelectedValue.ToString() != "")
            {
                id_cliente = Convert.ToInt32(this.dl_cliente.SelectedValue.ToString());
            }

            if (this.txt_operacion.Text.Trim() != "")
            {
                id_solicitud = Convert.ToInt32(this.txt_operacion.Text);
            }

            if (this.dl_familia.SelectedValue.ToString() != "")
            {
                id_familia = Convert.ToInt16(this.dl_familia.SelectedValue.ToString());
            }

            if (this.dl_producto.SelectedValue.ToString() != "")
            {
                id_codigo = this.dl_producto.SelectedValue.ToString();
            }

            string add = "";

            add = new MatrizExcelBC().getmatrizinforme(desde, hasta, Session["usrname"].ToString(), sp_informe, this.dl_producto.SelectedValue, 0, sucursal, id_cliente,
                                                       id_solicitud, 0, 0, this.txt_cliente.Text.Trim(), this.txt_patente.Text.Trim(), 0, 0, 0, ciudad, id_familia, titulo);

            string strAlerta = "window.open('http://sistema.agpsa.cl/Reportes_Excel/" + add.ToString().Trim() + "');";

            //ScriptManager.RegisterStartupScript(Page,Page.GetType(), "", strAlerta, true);
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "", strAlerta, true);


            return;
        }
Ejemplo n.º 2
0
        protected void carga_excel(string sp_informe, string titulo)
        {
            string desde = string.Format("{0:yyyyMMdd}", DateTime.Now);
            string hasta = string.Format("{0:yyyyMMdd}", DateTime.Now);

            if (this.txt_desde.Text.Trim() != "")
            {
                desde = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_desde.Text.Trim()));
            }
            if (this.txt_hasta.Text.Trim() != "")
            {
                hasta = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_hasta.Text.Trim()));
            }

            int id_familia = 0;


            string add = "";

            add = new MatrizExcelBC().getmatrizinforme_Excel((string)(Session["usrname"]), desde, hasta, sp_informe, id_familia, titulo);

            string strAlerta = "window.open('http://sistema.agpsa.cl/Reportes_Excel/" + add.ToString().Trim() + "');";

            //ScriptManager.RegisterStartupScript(Page,Page.GetType(), "", strAlerta, true);
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "", strAlerta, true);


            return;
        }
Ejemplo n.º 3
0
        protected void ib_exportar_Click(object sender, ImageClickEventArgs e)
        {
            string desde = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_desde.Text.Trim()));
            string hasta = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_hasta.Text.Trim()));


            string add = "";

            if (this.dl_familia.SelectedValue == "19")
            {
                add = new MatrizExcelBC().getMatrizRetiroCarpeta(desde, hasta, Session["usrname"].ToString());

                string strAlerta = "window.open('http://sistema.agpsa.cl/Reportes_Excel/" + add.ToString().Trim() + "');";
                //ScriptManager.RegisterStartupScript(up, pPagina.GetType(), "", strAlerta, true);
                ScriptManager.RegisterStartupScript(this.up_arriba, this.up_arriba.GetType(), "", strAlerta, true);
            }



            return;
        }