protected void LnkBtn_Descargar_Click(object sender, EventArgs e)
        {
            if (Lista_nv.Rows.Count > 0)
            {
                Response.Clear();
                Response.Buffer = true;
                Response.AddHeader("content-disposition", "attachment;filename=InformeNV.xls");
                Response.Charset     = "";
                Response.ContentType = "application/vnd.ms-excel";
                using (StringWriter sw = new StringWriter())
                {
                    HtmlTextWriter hw = new HtmlTextWriter(sw);

                    //To Export all pages
                    Lista_nv.AllowPaging = false;
                    // this.BindGrid();

                    Lista_nv.HeaderRow.BackColor = Color.White;
                    foreach (TableCell cell in Lista_nv.HeaderRow.Cells)
                    {
                        cell.BackColor = Lista_nv.HeaderStyle.BackColor;
                    }
                    foreach (GridViewRow row in Lista_nv.Rows)
                    {
                        row.BackColor = Color.White;
                        foreach (TableCell cell in row.Cells)
                        {
                            if (row.RowIndex % 2 == 0)
                            {
                                cell.BackColor = Lista_nv.AlternatingRowStyle.BackColor;
                            }
                            else
                            {
                                cell.BackColor = Lista_nv.RowStyle.BackColor;
                            }
                            cell.CssClass = "textmode";
                        }
                    }

                    Lista_nv.RenderControl(hw);

                    //style to format numbers to string
                    string style = @"<style> .textmode { } </style>";
                    Response.Write(style);
                    Response.Output.Write(sw.ToString());
                    Response.Flush();
                    Response.End();
                }
            }
        }
        protected void muestra_seleccion(int v_tipo)
        {
            string queryString = "";

            lbl_mensaje.Text = "";
            queryString      = "informe_nv";


            using (MySqlConnection conn = new MySqlConnection(SMysql))
            {
                try
                {
                    conn.Open();
                    MySqlCommand command = new MySqlCommand(queryString, conn);
                    command.CommandType = CommandType.StoredProcedure;

                    command.Parameters.AddWithValue("@v_tipo", v_tipo);
                    command.Parameters["@v_tipo"].Direction = ParameterDirection.Input;

                    DataSet          ds        = new DataSet();
                    MySqlDataAdapter mysqlDAdp = new MySqlDataAdapter(command);
                    MySqlDataReader  dr        = command.ExecuteReader();

                    if (!dr.HasRows)
                    {
                        lbl_mensaje.Text    = "Informe no entregó resultados";
                        Lista_nv.DataSource = null;
                        Lista_nv.DataBind();
                    }
                    else
                    {
                        Lista_nv.DataSource = dr;
                        Lista_nv.DataBind();

                        lbl_cantidad.Text = "Cantidad de Registros: " + Convert.ToString(Lista_nv.Rows.Count);
                    }

                    //Productos.DataMember = "tbl_items";

                    conn.Close();
                    conn.Dispose();
                }
                catch (Exception ex)
                {
                    lbl_error.Text = ex.Message;
                    conn.Close();
                    conn.Dispose();
                }
            }
        }