예제 #1
0
        private void listadobtn_Click(object sender, EventArgs e)
        {
            ListasMensuales frm = this.FormInstances;

            if (Cmb_grupo.Text == "Seleccione el grupo")
            {
                MessageBox.Show("No se ha seleccionado ningun grado", "◄ AVISO |  Sistema de Control Escolar ►", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                frm.grado = Convert.ToString(Cmb_grupo.Text);


                if (txtruta.Text == "Nombre del archivo")
                {
                    MessageBox.Show("El campo nombre no puede estar vacio", "◄ AVISO |  Sistema de Control Escolar ►", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtruta.BorderColorIdle = Color.Red;
                }
                else
                {
                    // se verifica si el formulario no esta minimizado, en caso de estarlo
                    // se lo cambia a un estado normal
                    if (frm.WindowState == FormWindowState.Minimized)
                    {
                        frm.WindowState = FormWindowState.Normal;
                    }
                    AddOwnedForm(frm);
                    frm.FormBorderStyle = FormBorderStyle.FixedSingle;
                    //frm.TopLevel = false;
                    frm.StartPosition = FormStartPosition.CenterScreen;
                    //frm.Dock = DockStyle.Fill;
                    //this.Controls.Add(frm);
                    this.Tag = frm;
                    frm.BringToFront();
                    frm.Enabled = true;
                    frm.Visible = false;
                    frm.Show();

                    Warning[] warnings;
                    string[]  streamids;
                    string    mimeType;
                    string    encoding;
                    string    extension;

                    byte[] bytes = frm.reportViewer1.LocalReport.Render(
                        "EXCEL", null, out mimeType, out encoding,
                        out extension,
                        out streamids, out warnings);

                    FileStream fs = new FileStream(@"C:\Users\Dreamer\Documents\BOLETAS\" + txtruta.Text + ".xls",
                                                   FileMode.Create);
                    fs.Write(bytes, 0, bytes.Length);
                    fs.Close();
                    //frm.Close();
                    MessageBox.Show("Lista creada y guarda con exito", " AVISO | CONTROL ESCOLAR ►", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
예제 #2
0
 void form_Disposede(object sender, EventArgs e)
 {
     modify = null;
 }
예제 #3
0
 private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e)
 {
     if (txlista.Text == "1°A")
     {
         ListasMensuales frm = this.Formi;
         frm.grado = Convert.ToString(txlista.Text);
         if (frm.WindowState == FormWindowState.Minimized)
         {
             frm.WindowState = FormWindowState.Normal;
         }
         AddOwnedForm(frm);
         frm.FormBorderStyle = FormBorderStyle.FixedSingle;
         //frm.TopLevel = false;
         frm.StartPosition = FormStartPosition.CenterScreen;
         //frm.Dock = DockStyle.Fill;
         //this.Controls.Add(frm);
         this.Tag = frm;
         frm.BringToFront();
         frm.Enabled = true;
         frm.Visible = true;
         frm.Show();
     }
     if (txlista.Text == "2°A")
     {
         ListasMensuales frm1 = this.Formi;
         frm1.grado = Convert.ToString(txlista.Text);
         if (frm1.WindowState == FormWindowState.Minimized)
         {
             frm1.WindowState = FormWindowState.Normal;
         }
         AddOwnedForm(frm1);
         frm1.FormBorderStyle = FormBorderStyle.FixedSingle;
         //frm.TopLevel = false;
         frm1.StartPosition = FormStartPosition.CenterScreen;
         //frm.Dock = DockStyle.Fill;
         //this.Controls.Add(frm);
         this.Tag = frm1;
         frm1.BringToFront();
         frm1.Enabled = true;
         //frm1.Visible = true;
         frm1.Show();
         //listasEscolares nom = new listasEscolares();
         //nom.Show();
     }
     if (txlista.Text == "3°A")
     {
         listas3A frm = this.Forminstanc;
         frm.grado = Convert.ToString(txlista.Text);
         if (frm.WindowState == FormWindowState.Minimized)
         {
             frm.WindowState = FormWindowState.Normal;
         }
         AddOwnedForm(frm);
         frm.FormBorderStyle = FormBorderStyle.FixedSingle;
         //frm.TopLevel = false;
         frm.StartPosition = FormStartPosition.CenterScreen;
         //frm.Dock = DockStyle.Fill;
         //this.Controls.Add(frm);
         this.Tag = frm;
         frm.BringToFront();
         frm.Enabled = true;
         frm.Visible = true;
         frm.Show();
     }
     if (txlista.Text == "4°A")
     {
         listas4_6 frm = this.Forminstan;
         frm.grado = Convert.ToString(txlista.Text);
         if (frm.WindowState == FormWindowState.Minimized)
         {
             frm.WindowState = FormWindowState.Normal;
         }
         AddOwnedForm(frm);
         frm.FormBorderStyle = FormBorderStyle.FixedSingle;
         //frm.TopLevel = false;
         frm.StartPosition = FormStartPosition.CenterScreen;
         //frm.Dock = DockStyle.Fill;
         //this.Controls.Add(frm);
         this.Tag = frm;
         frm.BringToFront();
         frm.Enabled = true;
         frm.Visible = true;
         frm.Show();
     }
     if (txlista.Text == "5°A")
     {
         listas4_6 frm = this.Forminstan;
         frm.grado = Convert.ToString(txlista.Text);
         if (frm.WindowState == FormWindowState.Minimized)
         {
             frm.WindowState = FormWindowState.Normal;
         }
         AddOwnedForm(frm);
         frm.FormBorderStyle = FormBorderStyle.FixedSingle;
         //frm.TopLevel = false;
         frm.StartPosition = FormStartPosition.CenterScreen;
         //frm.Dock = DockStyle.Fill;
         //this.Controls.Add(frm);
         this.Tag = frm;
         frm.BringToFront();
         frm.Enabled = true;
         frm.Visible = true;
         frm.Show();
     }
     if (txlista.Text == "6°A")
     {
         listas4_6 frm = this.Forminstan;
         frm.grado = Convert.ToString(txlista.Text);
         if (frm.WindowState == FormWindowState.Minimized)
         {
             frm.WindowState = FormWindowState.Normal;
         }
         AddOwnedForm(frm);
         frm.FormBorderStyle = FormBorderStyle.FixedSingle;
         //frm.TopLevel = false;
         frm.StartPosition = FormStartPosition.CenterScreen;
         //frm.Dock = DockStyle.Fill;
         //this.Controls.Add(frm);
         this.Tag = frm;
         frm.BringToFront();
         frm.Enabled = true;
         frm.Visible = true;
         frm.Show();
     }
 }