Ejemplo n.º 1
0
        public void Esport()
        {
            Hashtable _HS     = (Hashtable)Session["ParametriSelectSchema"];
            string    VISTA   = Convert.ToString(_HS["NomeVista"]);
            int       IdVista = Convert.ToInt32(_HS["IdVista"]);

            VISTA = " " + VISTA + " ";
            TheSite.GIC.App_Code.Consultazioni.interogazioni DQ = new TheSite.GIC.App_Code.Consultazioni.interogazioni();
            DQ.VISTA   = VISTA;
            DQ.IdVista = IdVista;
            DataSet Dt = DQ.GetData(IdQ);

            Csy.WebControls.Export _objExport = new Csy.WebControls.Export();
            DataTable _dt = new DataTable();

            _dt = Dt.Tables[0].Copy();
            if (_dt.Rows.Count != 0)
            {
                _objExport.ExportDetails(_dt, Csy.WebControls.Export.ExportFormat.Excel, "exp.xls");
            }
            else
            {
                String scriptString = "<script language=JavaScript>alert('Nessun elemento da esportare');";
                scriptString += "/";
                scriptString += "script>";

                if (!this.IsClientScriptBlockRegistered("clientScriptexp"))
                {
                    this.RegisterStartupScript("clientScriptexp", scriptString);
                }
            }
        }
Ejemplo n.º 2
0
        public void DysplayGrid()
        {
            Hashtable _HS     = (Hashtable)Session["ParametriSelectSchema"];
            string    VISTA   = Convert.ToString(_HS["NomeVista"]);
            int       IdVista = Convert.ToInt32(_HS["IdVista"]);

            VISTA = " " + VISTA + " ";
            TheSite.GIC.App_Code.Consultazioni.interogazioni DQ = new TheSite.GIC.App_Code.Consultazioni.interogazioni();
            DQ.VISTA   = VISTA;
            DQ.IdVista = IdVista;
            DataGridQuery.DataSource = DQ.GetData(IdQ);
            DataGridQuery.DataBind();
        }