Example #1
0
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   13/Jan/2014
        /// Description:    Get Exception List to export
        /// </summary>
        private void ExportReport()
        {
            DataTable dt = null;

            try
            {
                List <RemarksByDateList> listSource = new List <RemarksByDateList>();
                if (Session["CrewAssistRemarksReportByDate_RemarksList"] != null)
                {
                    listSource = (List <RemarksByDateList>)Session["CrewAssistRemarksReportByDate_RemarksList"];
                    dt         = getDataTable(listSource);
                }
                else
                {
                    dt = BLL.GetCrewAssistRemarksByDateExport(uoHiddenFieldUser.Value);
                }


                if (dt.Rows.Count > 0)
                {
                    CreateFile(dt);
                }
                else
                {
                    AlertMessage("No record to export!");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }