//DataGrid Functions
    private void DisplayGrid()
    {
        try
        {
            Whitfieldcore _dbClass = new Whitfieldcore();
            DataSet _dsWorkOrders = new DataSet();
            _dsWorkOrders = _dbClass.GetAllMaterials(Convert.ToInt32(ddlMatType.SelectedItem.Value));
            PopulateDataGrid(_dsWorkOrders, grdpl1);

        }
        catch (Exception exp)
        {
            Response.Write(exp.Message.ToString());
        }
    }
 protected void btnexport_Click(object sender, EventArgs e)
 {
     try
     {
         Whitfieldcore _dbClass = new Whitfieldcore();
         DataSet dsRpAdvances = _dbClass.GetAllMaterials(Convert.ToInt32(ddlMatType.SelectedItem.Value));
         ExportDataSetToExcel(dsRpAdvances, "SystemListing.xls");
     }
     catch (Exception)
     {
         throw;
     }
 }