Exemple #1
0
        private bool GenerateReportFiles(string p_eMailId)
        {
            bool functionReturnValue = false;
            string[] str = new string[101];
            string[] FileName = null;
            string AppPath = null;
            string ZipFileName = null;
            List<string> ParaList = new List<string>();
            functionReturnValue = false;
            try
            {
                AppPath = "C:\\BMCLHR_";
                AppPath = AppPath + GlobalVar.g_WorkDate;
                ZipFileName = "C:\\BMCLHR_";
                ZipFileName = ZipFileName + GlobalVar.g_WorkDate;
                ZipFileName = ZipFileName + ".zip";
                DataTable dt = new DataTable();
                dt = obj_bllEmailManager.GetEmailSettings(p_eMailId);
                str = dt.Rows[0]["ParameterValues"].ToString().Split(';');
                for (int i = 0; i <= str.Length-1; i++)
                {
                    ParaList.Add(str[i]);
                }
                switch (dt.Rows[0]["FileType"].ToString())
                {
                    case "Acrobat":
                        ParaList.Add("Acrobat");
                        break;
                    case "MS Word":
                        ParaList.Add("Word");
                        break;
                    case "MS Excel (Formated)":
                        ParaList.Add("Excel");
                        break;
                    case "MS Excel (Data only)":
                        ParaList.Add("Excel Data");
                        break;
                    case "Rich Text":
                        ParaList.Add("Rich Text");
                        break;
                }

                ParaList.Add(AppPath +"\\" + "ReportPath");
                ParaList.Add("Preview"+ "SelectedOption");

                if (Directory.Exists(AppPath))
                {
                    FileName = Directory.GetFiles(AppPath);
                    for (int I = 0; I <= FileName.Length -1 ; I++)
                    {
                        File.Delete(FileName[I]);
                    }
                    Directory.Delete(AppPath);
                }
                Directory.CreateDirectory(AppPath);
                rptModuleListView rpt = new rptModuleListView();
                rpt.ModuleParaList = ParaList;
                rpt.GenerateReport();
                functionReturnValue = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                functionReturnValue = false;
            }
            return functionReturnValue;
        }
 public void ShowReport(string vReportId)
 {
     switch (vReportId)
     {
         case "Admin001":
             rptModuleListView rptModuleList = new rptModuleListView();
             rptModuleList.ActiveConnection = ActiveConnection;
             rptModuleList.GenerateReport();
             break;
     }
 }