Exemplo n.º 1
0
        public DBFilter GetPassOffenseEffFilter(ScFilterList scFilterList)
        {
            DBFilter EffFilter = new DBFilter();

            foreach (ScAFilter scFilter in scFilterList.ScFilters)
            {
                if (scFilter.ReportScType != 20 || !(scFilter.Name.EndsWith("-PASSEFF-O")))
                {
                    continue;
                }

                for (int i = 0; i < scFilter.Elements.Count; i++)
                {
                    ScFilterElement element = scFilter.Elements[i];

                    Webb.Data.DBCondition condition = new Webb.Data.DBCondition();

                    condition.ColumnName = element.Field;

                    condition.Value = element.Value;

                    condition.FilterType = GetFilterOper(element.Oper);

                    condition.FollowedOperand = this.GetFilterOpr(element.Opr);

                    if (i == scFilter.Elements.Count - 1)
                    {
                        condition.FollowedOperand = FilterOperands.Or;
                    }

                    condition.IgnoreCase = true;

                    EffFilter.Add(condition);
                }

                EffFilter.PlayAfter = scFilter.PlayAfter == 1;
            }

            EffFilter.IsCustomFilter = true;   //2010-11-1 12:11:46@Simon Add this Code

            EffFilter.Name = "PassOffenseEFF"; //2009-4-29 12:11:46@Simon Add this Code

            return(EffFilter);
        }
        public string CreateReport(string strInwFile, string strFile, string dllpath)
        {
            Webb.Utility.CurReportMode = 2;

            strFile = AdjustPDFFile(strFile);

            string[] args = InwManager.ReadInwFile(strInwFile);

            if (args == null)
            {
                return("Failed");
            }


            CommandManager m_CmdManager = new CommandManager(args);

            DBSourceConfig m_Config = m_CmdManager.CreateDBConfig();

            WebbDataProvider m_DBProvider = new WebbDataProvider(m_Config);

            WebbDataSource m_DBSource = new WebbDataSource();

            try
            {
                m_DBProvider.GetDataSource(m_Config, m_DBSource);

                ArrayList m_Fields = new ArrayList();

                foreach (System.Data.DataColumn m_col in m_DBSource.DataSource.Tables[0].Columns)
                {
                    if (m_col.Caption == "{EXTENDCOLUMNS}" && m_col.ColumnName.StartsWith("C_"))
                    {
                        continue;
                    }

                    m_Fields.Add(m_col.ColumnName);
                }

                Webb.Data.PublicDBFieldConverter.SetAvailableFields(m_Fields);

                Webb.Reports.DataProvider.VideoPlayBackManager.DataSource = m_DBSource.DataSource;      //Set dataset for click event

                Webb.Reports.DataProvider.VideoPlayBackManager.PublicDBProvider = m_DBProvider;

                Webb.Reports.DataProvider.VideoPlayBackManager.LoadAdvScFilters();      //Modified at 2009-1-19 13:48:30@Scott

                m_DBProvider.UpdateEFFDataSource(m_DBSource);

                Webb.Reports.DataProvider.VideoPlayBackManager.ReadPictureDirFromRegistry();
            }
            catch (Exception e)
            {
                return("Failed:at addding datasouce|" + e.Message);
            }

            FilterInfoCollection filterInfos = m_DBSource.Filters;  //2009-7-1 11:09:08@Simon Add this Code  For Union Print

            if (filterInfos == null)
            {
                filterInfos = new FilterInfoCollection();
            }

            if (m_Config.Templates.Count <= 0)
            {
                return("Failed:No tempaltes");
            }

            string strTemplate = m_Config.Templates[0];

            string strTemplateName = m_CmdManager.GetTemplateName(strTemplate, '@');    //Modified at 2009-2-3 9:17:34@Scott

            WebbReport m_Report = null;

            try
            {
                m_Report = m_CmdManager.CreateReport(dllpath, strTemplateName); //1 //create report with template
            }
            catch (Exception ex)
            {
                return("Failed:Can't load report template" + ex.Message);
            }

            //Add attached filter here
            #region Modified Area

            m_DBSource.Filters = filterInfos.Copy();  //2009-7-1 11:09:04@Simon Add this Code  For Union Print

            string strFilterName = m_CmdManager.GetAttachedFilter(strTemplate, '@');

            if (strFilterName != string.Empty)  //2009-7-1 11:09:04@Simon For display Filternames In GameListInfo
            {
                if (!m_DBProvider.DBSourceConfig.Filters.Contains(strFilterName))
                {
                    FilterInfo filterInfo = new FilterInfo();

                    filterInfo.FilterName = strFilterName;

                    m_DBSource.Filters.Add(filterInfo);
                }
            }

            ScAFilter scaFilter = Webb.Reports.DataProvider.VideoPlayBackManager.AdvReportFilters.GetFilter(strFilterName);     //Modified at 2009-1-19 14:25:30@Scott

            AdvFilterConvertor convertor = new AdvFilterConvertor();

            DBFilter AdvFilter = convertor.GetReportFilter(scaFilter).Filter;

            if (AdvFilter != null || AdvFilter.Count > 0)  //2009-5-6 9:38:37@Simon Add this Code
            {
                AdvFilter.Add(m_Report.Template.Filter);
                m_Report.Template.Filter = AdvFilter;
            }

            SectionFilterCollection sectionFilter = m_Report.Template.SectionFilters.Copy();

            if (m_Report.Template.ReportScType == ReportScType.Custom)
            {
                m_Report.Template.SectionFilters = AdvFilterConvertor.GetCustomFilters(Webb.Reports.DataProvider.VideoPlayBackManager.AdvReportFilters, sectionFilter);
            }

            #endregion        //Modify at 2008-11-24 16:04:05@Scott

            try
            {
                if (System.IO.File.Exists(strFile))
                {
                    System.IO.File.Delete(strFile);
                }

                m_Report.LoadAdvSectionFilters(m_Config.UserFolder);

                m_Report.SetWatermark(m_Config.WartermarkImagePath);    //06-19-2008@Scott

                m_Report.SetDataSource(m_DBSource);

                m_Report.CreatePdfDocument(strFile);

                if (!System.IO.File.Exists(strFile))
                {
                    return("Failed:dll path " + dllpath);
                }
            }
            catch (Exception ex2)
            {
                return("Failed:in create PDf Documnet|" + ex2.Message);
            }

            return(strFile);
        }
        public string ExportUnionReportToPdf(string strInwFile, string DestinationPdfFile)
        {
            Webb.Utility.CurReportMode = 2;

            DestinationPdfFile = AdjustPDFFile(DestinationPdfFile);

            string[] args = InwManager.ReadInwFile(strInwFile);

            if (args == null)
            {
                return("Failed");
            }

            CommandManager m_CmdManager = new CommandManager(args);

            DBSourceConfig m_Config = m_CmdManager.CreateDBConfig();

            WebbDataProvider m_DBProvider = new WebbDataProvider(m_Config);

            WebbDataSource m_DBSource = new WebbDataSource();

            try
            {
                m_DBProvider.GetDataSource(m_Config, m_DBSource);


                ArrayList m_Fields = new ArrayList();

                foreach (System.Data.DataColumn m_col in m_DBSource.DataSource.Tables[0].Columns)
                {
                    if (m_col.Caption == "{EXTENDCOLUMNS}" && m_col.ColumnName.StartsWith("C_"))
                    {
                        continue;
                    }

                    m_Fields.Add(m_col.ColumnName);
                }

                Webb.Data.PublicDBFieldConverter.SetAvailableFields(m_Fields);

                Webb.Reports.DataProvider.VideoPlayBackManager.DataSource = m_DBSource.DataSource;      //Set dataset for click event

                Webb.Reports.DataProvider.VideoPlayBackManager.PublicDBProvider = m_DBProvider;

                //Webb.Reports.DataProvider.VideoPlayBackManager.ReadPictureDirFromRegistry();

                Webb.Reports.DataProvider.VideoPlayBackManager.LoadAdvScFilters();      //Modified at 2009-1-19 13:48:30@Scott

                m_DBProvider.UpdateEFFDataSource(m_DBSource);
            }
            catch (Exception e)
            {
                return("Failed:at addding datasouce|" + e.Message);
            }

            FilterInfoCollection filterInfos = m_DBSource.Filters;  //2009-7-1 11:09:08@Simon Add this Code  For Union Print

            if (filterInfos == null)
            {
                filterInfos = new FilterInfoCollection();
            }

            if (m_Config.Templates.Count <= 0)
            {
                return("Failed");
            }

            XtraReport[] preparedReports = new WebbReport[m_Config.Templates.Count];

            if (System.IO.File.Exists(DestinationPdfFile))
            {
                System.IO.File.Delete(DestinationPdfFile);
            }

            System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();

            string dllPath = System.IO.Path.GetDirectoryName(asm.Location);

            if (!dllPath.EndsWith(@"\"))
            {
                dllPath += @"\";
            }

            for (int i = 0; i < m_Config.Templates.Count; i++)
            {
                string strTemplate = m_Config.Templates[i];

                string strTemplateName = m_CmdManager.GetTemplateName(strTemplate, '@');        //Modified at 2009-2-3 9:17:34@Scott

                WebbReport m_Report = null;

                try
                {
                    m_Report = m_CmdManager.CreateReport(dllPath, strTemplateName);     //1 //create report with template
                }
                catch (Exception ex)
                {
                    return("Failed:in create report" + ex.Message);
                }

                //Add attached filter here
                #region Modified Area

                m_DBSource.Filters = filterInfos.Copy();  //2009-7-1 11:09:04@Simon Add this Code  For Union Print

                string strFilterName = m_CmdManager.GetAttachedFilter(strTemplate, '@');

                if (strFilterName != string.Empty)  //2009-7-1 11:09:04@Simon For display Filternames In GameListInfo
                {
                    if (!m_DBProvider.DBSourceConfig.Filters.Contains(strFilterName))
                    {
                        FilterInfo filterInfo = new FilterInfo();

                        filterInfo.FilterName = strFilterName;

                        m_DBSource.Filters.Add(filterInfo);
                    }
                }

                ScAFilter scaFilter = Webb.Reports.DataProvider.VideoPlayBackManager.AdvReportFilters.GetFilter(strFilterName); //Modified at 2009-1-19 14:25:30@Scott

                AdvFilterConvertor convertor = new AdvFilterConvertor();

                DBFilter AdvFilter = convertor.GetReportFilter(scaFilter).Filter;

                if (AdvFilter != null || AdvFilter.Count > 0)  //2009-5-6 9:38:37@Simon Add this Code
                {
                    AdvFilter.Add(m_Report.Template.Filter);
                    m_Report.Template.Filter = AdvFilter;
                }
                #endregion        //Modify at 2008-11-24 16:04:05@Scott

                try
                {
                    m_Report.LoadAdvSectionFilters(m_Config.UserFolder);

                    m_Report.SetWatermark(m_Config.WartermarkImagePath);        //06-19-2008@Scott

                    m_Report.SetDataSource(m_DBSource);

                    preparedReports[i] = m_Report;
                }
                catch (Exception ex2)
                {
                    return("Failed:load report|" + ex2.Message);
                }
            }
            try
            {
                XtraReport.UnionReportsToPdf(preparedReports, DestinationPdfFile);
            }
            catch (Exception ex3)
            {
                return("Failed:in create PDf Documnet|" + ex3.Message);
            }

            if (!System.IO.File.Exists(DestinationPdfFile))
            {
                return("Failed:file didn't exist");
            }

            return(DestinationPdfFile);
        }
        public static DBFilter ConvertToDBFilter(int i_FilterID, IDBManager i_DBManager)
        {
            DataTable m_FilterTable = GetFilterInfoTable(i_FilterID, i_DBManager);

            DBFilter m_DBFilter = new DBFilter();

            foreach (DataRow i_Row in m_FilterTable.Rows)
            {
                string m_OP = i_Row["Lable"].ToString();

                string m_Field = i_Row["FieldName"].ToString();

                FilterTypes m_FilterType = FilterTypes.StrEqual;

                object m_Value = i_Row["Value"];

                FilterOperands m_FilterOperand = FilterOperands.And;

                FilterCatalogs m_FilterCatalog = VictoryFilterHelper.GetCatalogFromFieldName(m_Field);

                switch (m_OP)
                {
                case "Any Entry":
                {
                    continue;
                }

                case "No Entry":
                {
                    return(null);
                }

                case "Equal":
                {
                    if (m_FilterCatalog == FilterCatalogs.Number)
                    {
                        m_FilterType = FilterTypes.NumEqual;
                    }
                    else
                    {
                        m_FilterType = FilterTypes.StrEqual;
                    }
                    break;
                }

                case "Greater Than":
                {
                    m_FilterType = FilterTypes.NumGreater;

                    break;
                }

                case "Less Than":
                {
                    m_FilterType = FilterTypes.NumLess;

                    break;
                }

                case "Starts With":
                {
                    m_FilterType = FilterTypes.StrStartWith;

                    break;
                }

                case "Ends With":
                {
                    m_FilterType = FilterTypes.StrEndWith;

                    break;
                }

                case "Includes":
                {
                    m_FilterType = FilterTypes.StrInclude;

                    break;
                }

                case "From To":
                {
                    m_FilterType = FilterTypes.NumLessOrEqual;

                    m_Value = i_Row["vMax"];

                    //"From To" convert to two conditions
                    DBCondition m_DBConditionAdd = new DBCondition(m_Field, FilterTypes.NumGreaterOrEqual, i_Row["vMin"], Bracket.NONE, m_FilterOperand);

                    m_DBFilter.Add(m_DBConditionAdd);

                    break;
                }

                case "Offense":
                case "Defense":
                case "Kick":
                case "Practice":
                case "1st Down":
                case "2nd Down":
                case "3rd Down":
                case "4th Down":
                case "Left":
                case "Right":
                case "Middle":
                case "Run":
                case "Pass":
                {
                    m_FilterType = FilterTypes.StrEqual;

                    m_Value = m_OP;

                    break;
                }

                case "0":
                case "1":
                case "2":
                case "3":
                case "4":
                case "5":
                case "6":
                case "7":
                case "8":
                case "9":
                case "10":
                {
                    m_FilterType = FilterTypes.NumEqual;

                    m_Value = m_OP;

                    break;
                }

                default:
                    continue;
                }
                //switch end
                DBCondition m_DBCondition = new DBCondition(m_Field, m_FilterType, m_Value, Bracket.NONE, m_FilterOperand);

                m_DBFilter.Add(m_DBCondition);
            }

            return(m_DBFilter);
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            if (args == null || (args.Length != 1 && args.Length != 10))
            {
                return;
            }

            ReportFileType fileType = ReportFileType.Report;

            DataSet dsDataset = null;

            if (args.Length == 1)
            {
                string filename = args[0];

                if (filename.IndexOf("\n") > 0)
                {
                    args = filename.Split("\n".ToCharArray());

                    if (args.Length != 10)
                    {
                        return;
                    }
                }
                else if (filename.EndsWith(".wmks"))
                {
                    wmksFileManager.WriteFile(filename);

                    return;
                }
                else if (filename.EndsWith(".repx"))
                {
                    string Inwfilename = filename.Replace(".repx", ".inw");

                    args = InwManager.ReadInwFile(Inwfilename);

                    fileType = ReportFileType.InwFile;

                    if (args == null)
                    {
                        args = ConfigFileManager.ReadDataConfig(filename);

                        fileType = ReportFileType.BaseXmlFile;
                    }
                }
                else if (filename.EndsWith(".repw"))
                {
                    string Inwfilename = filename.Replace(".repw", ".inw");

                    args = InwManager.ReadInwFile(Inwfilename);

                    fileType = ReportFileType.InwFile;

                    if (args == null)
                    {
                        args = ConfigFileManager.ReadDataConfig(filename);

                        fileType = ReportFileType.BaseXmlFile;
                    }
                }
                else if (filename.EndsWith(".inw"))
                {
                    args = InwManager.ReadInwFile(filename);

                    fileType = ReportFileType.InwFile;
                }
                else if (filename.EndsWith(".wrdf"))
                {
                    WrdfFileManager.ReadDataConfig(filename, out dsDataset, out args);

                    fileType = ReportFileType.WebbDataFile;
                }
                else
                {
                    return;
                }
                if (args == null)
                {
                    return;
                }
            }

            if (args[3] == "DBConn:" && args[8] == @"Files:")
            {
                return;
            }

            Webb.Utility.CurReportMode = 1;             //set browser mode

            ThreadStart ts = new ThreadStart(LoadingThreadProc);

            Thread thread = new Thread(ts);

            thread.Start();

            CommandManager m_CmdManager = new CommandManager(args);

            //Calculate data source
            if (thread.IsAlive)
            {
                LoadingForm.MessageText = "Loading Data Source...";
            }

            DBSourceConfig m_Config = m_CmdManager.CreateDBConfig();

            if (m_Config.Templates.Count == 0)
            {
                if (thread.IsAlive)
                {
                    LoadingForm.Close();

                    thread.Abort();
                }

                Webb.Utilities.TopMostMessageBox.ShowMessage("Invalid template report name!", MessageBoxButtons.OK);

                Environment.Exit(0);
            }


            if (m_CmdManager.PrintDirectly)
            {
                if (PrinterSettings.InstalledPrinters.Count == 0)
                {
                    if (thread.IsAlive)
                    {
                        LoadingForm.Close();

                        thread.Abort();
                    }

                    Webb.Utilities.TopMostMessageBox.ShowMessage("No printer driver is installed!", MessageBoxButtons.OK);

                    Environment.Exit(0);
                }
            }

            WebbDataProvider m_DBProvider = new WebbDataProvider(m_Config);

            WebbDataSource m_DBSource = new WebbDataSource();

            if (fileType == ReportFileType.WebbDataFile && dsDataset == null)
            {
                m_DBSource.DataSource = dsDataset.Copy();
            }
            else
            {
                m_DBProvider.GetDataSource(m_Config, m_DBSource);
            }

            ArrayList m_Fields = new ArrayList();

            foreach (System.Data.DataColumn m_col in m_DBSource.DataSource.Tables[0].Columns)
            {
                if (m_col.Caption == "{EXTENDCOLUMNS}" && m_col.ColumnName.StartsWith("C_"))
                {
                    continue;
                }

                m_Fields.Add(m_col.ColumnName);
            }


            Webb.Reports.DataProvider.VideoPlayBackManager.PublicDBProvider = m_DBProvider;

            Webb.Data.PublicDBFieldConverter.SetAvailableFields(m_Fields);

            Webb.Reports.DataProvider.VideoPlayBackManager.LoadAdvScFilters();  //Modified at 2009-1-19 13:48:30@Scott

            Webb.Reports.DataProvider.VideoPlayBackManager.ReadPictureDirFromRegistry();

            m_DBProvider.UpdateEFFDataSource(m_DBSource);

            Webb.Reports.DataProvider.VideoPlayBackManager.DataSource = m_DBSource.DataSource;  //Set dataset for click event


            //Loading report template
            if (thread.IsAlive)
            {
                LoadingForm.MessageText = "Loading Report Template...";
            }

            #region Modified Area
            ArrayList printedReports = new ArrayList();

            ArrayList invalidateReports = new ArrayList();

            bool unionprint = m_CmdManager.UnionPrint;

            #endregion                    //End Modify at 2008-10-10 14:29:49@Simon


            FilterInfoCollection filterInfos = m_DBSource.Filters;            //2009-7-1 11:09:08@Simon Add this Code  For Union Print

            if (filterInfos == null)
            {
                filterInfos = new FilterInfoCollection();
            }

            string printerName = m_CmdManager.PrinterName;

            foreach (string strTemplate in m_Config.Templates)
            {
                string strTemplateName = m_CmdManager.GetTemplateName(strTemplate, '@');                //Modified at 2009-2-3 9:17:34@Scott

                WebbReport m_Report = null;

                try
                {
                    m_Report = m_CmdManager.CreateReport(Application.ExecutablePath, strTemplateName);                          //1 //create report with template

                    //09-01-2011@Scott
                    if (m_Config.WebbDBType == WebbDBTypes.WebbPlaybook)
                    {
                        SetReportHeader(m_Config, m_Report, m_Config.HeaderName);  //Add this code at 2011-7-28 16:23:41@simon
                    }
                    else
                    {
                        string strHeader = m_CmdManager.GetAttachedHeader(strTemplate, '@');

                        SetReportHeader(m_Config, m_Report, strHeader);
                    }
                    //End
                }
                catch (Exception ex)
                {
                    Webb.Utilities.TopMostMessageBox.ShowMessage("Error", "Can't load report template!\r\n" + ex.Message, MessageBoxButtons.OK);

                    m_Report = new WebbReport();
                }

                bool Canopen = CheckedUserRight(m_Report.LicenseLevel, m_Config.WebbDBType);

                string filename = System.IO.Path.GetFileNameWithoutExtension(strTemplateName);

                if (!Canopen)
                {
                    invalidateReports.Add(filename);
                }
                else
                {
                    //Add attached filter here
                    #region Modified Area

                    m_DBSource.Filters = filterInfos.Copy();                     //2009-7-1 11:09:04@Simon Add this Code  For Union Print

                    string strFilterName = m_CmdManager.GetAttachedFilter(strTemplate, '@');

                    if (strFilterName != string.Empty)                   //2009-7-1 11:09:04@Simon For display Filternames In GameListInfo
                    {
                        if (!m_DBProvider.DBSourceConfig.Filters.Contains(strFilterName))
                        {
                            FilterInfo filterInfo = new FilterInfo();

                            filterInfo.FilterName = strFilterName;

                            m_DBSource.Filters.Add(filterInfo);
                        }
                    }

                    ScAFilter          scaFilter = Webb.Reports.DataProvider.VideoPlayBackManager.AdvReportFilters.GetFilter(strFilterName);            //Modified at 2009-1-19 14:25:30@Scott
                    AdvFilterConvertor convertor = new AdvFilterConvertor();
                    DBFilter           AdvFilter = convertor.GetReportFilter(scaFilter).Filter;

                    if (AdvFilter != null || AdvFilter.Count > 0)               //2009-5-6 9:38:37@Simon Add this Code
                    {
                        AdvFilter.Add(m_Report.Template.Filter);
                        m_Report.Template.Filter = AdvFilter;
                    }

                    SectionFilterCollection sectionFilter = m_Report.Template.SectionFilters.Copy();

                    if (m_Report.Template.ReportScType == ReportScType.Custom)
                    {
                        m_Report.Template.SectionFilters = AdvFilterConvertor.GetCustomFilters(Webb.Reports.DataProvider.VideoPlayBackManager.AdvReportFilters, sectionFilter);
                    }

                    #endregion                            //Modify at 2008-11-24 16:04:05@Scott

                    //Set data source
                    if (thread.IsAlive)
                    {
                        LoadingForm.MessageText = "Set Data Source...";
                        LoadingForm.ProcessText = Webb.Utility.GetCurFileName();
                    }

                    m_Report.LoadAdvSectionFilters(m_Config.UserFolder);

                    m_Report.SetWatermark(m_Config.WartermarkImagePath);                        //06-19-2008@Scott

                    m_Report.SetDataSource(m_DBSource);
                }

                if (m_CmdManager.PrintDirectly)
                {
                    if (!Canopen)
                    {
                        if (!unionprint)
                        {
                            Webb.Utilities.TopMostMessageBox.ShowMessage("LicenseLevel Error", "This report is not designed for your Webb application!" + "", MessageBoxButtons.OK);
                        }
                        continue;
                    }
                    else
                    {
                        printedReports.Add(m_Report);
                    }

                    #region Modified Area
                    if (unionprint)
                    {
                        continue;                                       //Modified at 2008-10-10 10:04:37@Simon
                    }
                    //Print
                    if (Webb.Utility.CancelPrint)
                    {
                        if (thread.IsAlive)
                        {
                            LoadingForm.Close();

                            thread.Join();
                        }

                        return;
                    }

                    if (thread.IsAlive)
                    {
                        LoadingForm.MessageText = "Printing...";
                    }

                    if (printerName != string.Empty)
                    {
                        if (!PrinterExist(printerName))
                        {
                            Webb.Utilities.TopMostMessageBox.ShowMessage("Failed to Print", "WRB Cann't Find The Printer '" + printerName + "' in you system,please check the printer setting!",
                                                                         MessageBoxButtons.OK);
                            Environment.Exit(-1);
                        }
                        m_Report.Print(printerName);
                    }
                    else
                    {
                        m_Report.Print();
                    }
                    #endregion                            //End Modify at 2008-10-9 16:54:58@Simon
                }
                else
                {                //Browser
                    //Create report
                    if (thread.IsAlive)
                    {
                        LoadingForm.MessageText = "Creating Report Browser...";
                    }

                    WebbRepBrowser m_Browser = new WebbRepBrowser();

                    //m_Browser.LoadReport(new WebbReport[]{m_Report,m_Report});	//multiply report

                    if (m_Config.WebbDBType.ToString().ToLower().StartsWith("webbvictory"))
                    {
                        m_Browser.TopMost = true;
                    }
                    else
                    {
                        m_Browser.TopMost = false;
                    }
                    if (Canopen)
                    {
                        m_Browser.LoadReport(m_Report);
                    }

                    if (thread.IsAlive)
                    {
                        LoadingForm.Close();

                        thread.Join();
                    }

                    Webb.Reports.DataProvider.VideoPlayBackManager.PublicBrowser = m_Browser;                           //05-04-2008@Scott

                    if (!Canopen)
                    {
                        m_Browser.ReportName = filename;

                        m_Browser.InvertZorder();
//						Webb.Utilities.TopMostMessageBox.ShowMessage("LicenseLevel Error", "This report is not designed for your Webb application!\n So it would not open" + "", MessageBoxButtons.OK);
                    }

                    Application.Run(m_Browser);
                }
            }
            //add these codes for join all reports to print in only one document
            #region Modified Area

            WebbReport[] AllReportsToPrint = new WebbReport[printedReports.Count];

            for (int i = 0; i < printedReports.Count; i++)
            {
                AllReportsToPrint[i] = printedReports[i] as WebbReport;
            }

            if (m_CmdManager.PrintDirectly && unionprint)
            {
                if (AllReportsToPrint.Length == 0)
                {
                    Webb.Utilities.TopMostMessageBox.ShowMessage("No document", "No document could be print!",
                                                                 MessageBoxButtons.OK);
                }
                else
                {
                    if (thread.IsAlive)
                    {
                        LoadingForm.MessageText = "Printing...";

                        LoadingForm.ProcessText = "Union Printing Documents";
                    }

                    if (invalidateReports.Count > 0)
                    {
                        Webb.Utilities.AutoClosedMessageBox.ShowMessage(invalidateReports);
                    }
                    if (printerName != string.Empty)
                    {
                        if (!PrinterExist(printerName))
                        {
                            Webb.Utilities.TopMostMessageBox.ShowMessage("Failed to Print", "WRB Cann'i Find The Printer '" + printerName + "' in you system,\nplease check the printer setting!",
                                                                         MessageBoxButtons.OK);
                            Environment.Exit(-1);
                        }

                        WebbReport.Print(printerName, AllReportsToPrint);
                    }
                    else
                    {
                        WebbReport.Print(AllReportsToPrint);
                    }
                }
            }
            #endregion                    //End Modify at 2008-10-10 9:42:07@Simon

            if (thread.IsAlive)
            {
                LoadingForm.Close();

                thread.Join();
            }
        }