Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     data = u.ConsultarEventos();
     reporte.SetDataSource(data);
     CrystalReportViewer1.ReportSource = reporte;
     CrystalReportViewer1.Height       = 200;
     CrystalReportViewer1.Width        = 400;
 }
        protected void Reporte(Object sender, EventArgs e)
        {
            if (Radio3.Checked && (eventos.SelectedIndex > 0))
            {
                int    a   = 0;
                string tex = "";
                if (eventos.SelectedIndex > 0)
                {
                    tex    = eventos.SelectedItem.Text;
                    dtuser = u.consultareventopornombre(tex);
                    if (dtuser.Rows.Count > 0)
                    {
                        druser = dtuser.Rows[0];
                        a      = Convert.ToInt32(druser["idevento"]);
                    }
                    data = u.consutaruserevento(a);
                    user.SetDataSource(data);
                    user.SetParameterValue("Mi parámetro", tex);
                    CrystalReportViewer1.ReportSource = user;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Seleccione un Evento');", true);
                }
            }
            else if (Radio4.Checked && (eventos.SelectedIndex > 0))
            {
                int    a   = 0;
                string tex = "";
                if (eventos.SelectedIndex > 0)
                {
                    tex    = eventos.SelectedItem.Text;
                    dtuser = u.consultareventopornombre(tex);
                    if (dtuser.Rows.Count > 0)
                    {
                        druser = dtuser.Rows[0];
                        a      = Convert.ToInt32(druser["idevento"]);
                    }
                    data = u.consultartemas(a);
                    tema.SetDataSource(data);
                    tema.SetParameterValue("Mi parámetro", tex);
                    CrystalReportViewer1.ReportSource = tema;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Seleccione un Evento');", true);
                }
            }
            else if (Radio1.Checked && (eventos.SelectedIndex > 0))
            {
                int    a   = 0;
                string tex = "";
                if (eventos.SelectedIndex > 0)
                {
                    tex    = eventos.SelectedItem.Text;
                    dtuser = u.consultareventopornombre(tex);
                    if (dtuser.Rows.Count > 0)
                    {
                        druser = dtuser.Rows[0];
                        a      = Convert.ToInt32(druser["idevento"]);
                    }
                    data = u.asistenciaevento(a);
                    asistente.SetDataSource(data);
                    asistente.SetParameterValue("Mi parámetro", tex);
                    CrystalReportViewer1.ReportSource = asistente;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Seleccione un Evento');", true);
                }
            }

            else if (Radio5.Checked && (eventos.SelectedIndex > 0))
            {
                int    a   = 0;
                string tex = "";
                if (eventos.SelectedIndex > 0)
                {
                    tex    = eventos.SelectedItem.Text;
                    dtuser = u.consultareventopornombre(tex);
                    if (dtuser.Rows.Count > 0)
                    {
                        druser = dtuser.Rows[0];
                        a      = Convert.ToInt32(druser["idevento"]);
                    }
                    data = u.consultarasistentes(a);
                    asis.SetDataSource(data);
                    asis.SetParameterValue("Mi parámetro", tex);
                    CrystalReportViewer1.ReportSource = asis;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Seleccione un Evento');", true);
                }
            }
            else
            if (Radio2.Checked)
            {
                data = u.ConsultarEventos();
                reporte.SetDataSource(data);
                CrystalReportViewer1.ReportSource = reporte;
            }
            CrystalReportViewer1.Height = 200;
            CrystalReportViewer1.Width  = 400;
        }