Exemplo n.º 1
0
        public DataTable GetAdminDashBoard(IReportData IReportData)
        {
            string    sqlCommand = "";
            DbCommand dbCommand;
            DataTable ds = new DataTable();
            Database  db = DatabaseFactory.CreateDatabase("SUPPORTTICKETS");

            sqlCommand = "proRptAdminDashBoard";
            dbCommand  = db.GetStoredProcCommand(sqlCommand);
            db.AddInParameter(dbCommand, "@SubID", DbType.String, IReportData.SubID);
            db.AddInParameter(dbCommand, "@FromDate", DbType.Date, IReportData.FromDate);
            db.AddInParameter(dbCommand, "@EndDate", DbType.Date, IReportData.ToDate);
            db.AddInParameter(dbCommand, "@FK_Client", DbType.Int64, IReportData.FK_Client);
            db.AddInParameter(dbCommand, "@FK_Store", DbType.Int64, IReportData.FK_Store);
            db.AddInParameter(dbCommand, "@Period", DbType.Byte, IReportData.Period);
            try
            {
                ds = db.ExecuteDataSet(dbCommand).Tables[0];
                return(ds);
            }
            catch (SqlException e)
            {
                throw;
            }
        }
Exemplo n.º 2
0
        public DataSet GetComparableGraph(IReportData IReportData)
        {
            string    sqlCommand = "";
            DbCommand dbCommand;
            DataSet   ds = new DataSet();
            Database  db = DatabaseFactory.CreateDatabase("SUPPORTTICKETS");

            sqlCommand = "proRptAdminDashBoardComparisonal";
            dbCommand  = db.GetStoredProcCommand(sqlCommand);
            db.AddInParameter(dbCommand, "@SubID", DbType.String, IReportData.SubID);
            db.AddInParameter(dbCommand, "@FromDate", DbType.Date, IReportData.FromDate);
            db.AddInParameter(dbCommand, "@EndDate", DbType.Date, IReportData.ToDate);
            db.AddInParameter(dbCommand, "@FK_Client", DbType.Int64, IReportData.FK_Client);
            // db.AddInParameter(dbCommand, "@FK_Store", DbType.Int64, IReportData.FK_Store);
            db.AddInParameter(dbCommand, "@CompareFrom", DbType.Date, IReportData.CompareDateFrom);
            db.AddInParameter(dbCommand, "@CompareTo", DbType.Date, IReportData.CompareDateTo);
            try
            {
                ds = db.ExecuteDataSet(dbCommand);
                return(ds);
            }
            catch (SqlException e)
            {
                throw;
            }
        }
Exemplo n.º 3
0
        private void PrintAction(IReportData data, SymbolBase symbol, StreamWriter output, ParserAction action)
        {
            if (action == null || action.Kind == ParserActionKind.Fail)
            {
                return;
            }

            output.Write(Indent);
            output.Write(symbol.Name);
            output.Write("             ");
            switch (action.Kind)
            {
            case ParserActionKind.Shift:
                output.Write("shift and go to state ");
                output.Write(action.State);
                break;

            case ParserActionKind.Reduce:
                output.Write("reduce using rule ");
                output.Write(action.ProductionId);
                break;

            case ParserActionKind.ShiftReduce:
                output.Write("shift-reduce using rule ");
                output.Write(action.ProductionId);
                break;

            case ParserActionKind.Accept:
                output.WriteLine("accept");
                break;
            }

            output.WriteLine();
        }
Exemplo n.º 4
0
        protected override ResultStatus Export()
        {
            try {
                //1.開始轉出資料
                panFilter.Enabled = false;
                labMsg.Visible    = true;
                labMsg.Text       = "開始轉檔...";
                this.Cursor       = Cursors.WaitCursor;
                this.Refresh();
                Thread.Sleep(5);

                //1.1 copy template xls to target path
                string   excelDestinationPath = PbFunc.wf_copy_file(_ProgramID, _ProgramID);
                Workbook workbook             = new Workbook();
                workbook.LoadDocument(excelDestinationPath);

                //2.匯出資料
                //共同的參數一起設定,init param = { D30395 dao, string startMonth }
                Object[] args = { dao30395, txtStartMonth.Text };

                int         pos = 0;
                IReportData GDF = CreateReport(GetType(), "GDF", args);
                pos += GDF.Export(workbook);

                //IReportData GDF_Detail = CreateReport(GetType(), "GDF_Detail", args);
                //GDF_Detail.Export(workbook);

                IReportData TGF = CreateReport(GetType(), "TGF", args);
                pos += TGF.Export(workbook);

                //IReportData TGF_Detail = CreateReport(GetType(), "TGF_Detail", args);
                //TGF_Detail.Export(workbook);

                if (pos <= 0)
                {
                    File.Delete(excelDestinationPath);
                    MessageDisplay.Info(MessageDisplay.MSG_NO_DATA, GlobalInfo.ResultText);
                    return(ResultStatus.Fail);
                }

                //存檔
                workbook.SaveDocument(excelDestinationPath);

                if (FlagAdmin)
                {
                    System.Diagnostics.Process.Start(excelDestinationPath);
                }

                return(ResultStatus.Success);
            } catch (Exception ex) {
                WriteLog(ex);
            } finally {
                panFilter.Enabled = true;
                labMsg.Text       = "";
                labMsg.Visible    = false;
                this.Cursor       = Cursors.Arrow;
            }
            return(ResultStatus.Fail);
        }
Exemplo n.º 5
0
        public void Build(IReportData data)
        {
            string path = Path.Combine(data.DestinationDirectory, fileName);

            var graph = new LrGraph(data);

            graph.WriteGv(path);
        }
        public void Build(IReportData data)
        {
            string path = Path.Combine(data.DestinationDirectory, fileName);

            using (var grammarFile = new StreamWriter(path, false, Encoding.UTF8))
            {
                grammarFile.Write(data.Grammar);
            }
        }
        public void Build(IReportData data)
        {
            string path = Path.Combine(data.DestinationDirectory, fileName);

            using (var grammarFile = new StreamWriter(path, false, Encoding.UTF8))
            {
                grammarFile.Write(data.Grammar);
            }
        }
Exemplo n.º 8
0
        private static StreamWriter DescribeState(
            IReportData data,
            int state,
            StreamWriter output,
            string indent)
        {
            var automata = data.ParserAutomata;

            return(DescribeState(data, automata.States[state], output, indent));
        }
Exemplo n.º 9
0
 public ManagerController(UserManager <ApplicationUser> userManager, IReportData reportData,
                          IManagerReportData managerReportData,
                          IWebHostEnvironment webHostEnvironment,
                          RoleManager <IdentityRole <short> > roleManager,
                          IManagerData managerData,
                          IMessageService messageService)
 {
     _userManager       = userManager;
     _managerData       = managerData;
     _reportData        = reportData;
     _managerReportData = managerReportData;
     _messageService    = messageService;
 }
Exemplo n.º 10
0
        private void PrintTransitions(IReportData data, StreamWriter output)
        {
            string title = "Language: " + data.Source.FullLanguageName;

            output.WriteLine(title);
            output.WriteLine();
            output.WriteLine("Grammar:");
            output.Write(data.Grammar);
            output.WriteLine();

            foreach (var state in data.ParserAutomata.States)
            {
                output.Write("State ");
                output.Write(state.Index);
                output.WriteLine();
                output.WriteLine();
                DescribeState(data, state, output, Indent);
                output.WriteLine();

                foreach (var transition in state.Transitions)
                {
                    var actions = transition.Actions;
                    int count   = actions.Count();

                    var symbol = data.Grammar.Symbols[transition.Token];

                    if (count == 0)
                    {
                    }
                    else if (count > 1)
                    {
                        output.Write(Indent);
                        output.WriteLine("conflict {");
                        foreach (var action in actions)
                        {
                            PrintAction(data, symbol, output, action);
                        }

                        output.Write(Indent);
                        output.WriteLine("}");
                        output.WriteLine();
                    }
                    else
                    {
                        PrintAction(data, symbol, output, actions.Single());
                    }
                }

                output.WriteLine();
            }
        }
Exemplo n.º 11
0
        public DataSet GetReportDataSource(IReportData IReportData)
        {
            string    sqlCommand = "";
            DbCommand dbCommand;
            DataSet   ds = new DataSet();
            Database  db = DatabaseFactory.CreateDatabase("SUPPORTTICKETS");

            sqlCommand = "proCmnReportData";
            dbCommand  = db.GetStoredProcCommand(sqlCommand);
            db.AddInParameter(dbCommand, "@SubModule", DbType.String, IReportData.SubModule);
            db.AddInParameter(dbCommand, "@Id", DbType.String, IReportData.ID);
            db.AddInParameter(dbCommand, "@SubID", DbType.String, IReportData.SubID);
            db.AddInParameter(dbCommand, "@FromDate", DbType.Date, IReportData.FromDate);
            db.AddInParameter(dbCommand, "@ToDate", DbType.Date, IReportData.ToDate);
            db.AddInParameter(dbCommand, "@FromStore", DbType.Int64, IReportData.FromStore);

            db.AddInParameter(dbCommand, "@FK_CategoryFirst", DbType.Int64, IReportData.FK_CategoryFirst);
            db.AddInParameter(dbCommand, "@FK_Items", DbType.Int64, IReportData.FK_Items);
            db.AddInParameter(dbCommand, "@FK_Store", DbType.Int64, IReportData.FK_Store);
            db.AddInParameter(dbCommand, "@FK_Client", DbType.Int64, IReportData.FK_Client);
            db.AddInParameter(dbCommand, "@Usercode", DbType.String, IReportData.UserCode);
            db.AddInParameter(dbCommand, "@XmlData", DbType.String, IReportData.XmlData);
            db.AddInParameter(dbCommand, "@FinYear", DbType.Int16, IReportData.FinYear);
            db.AddInParameter(dbCommand, "@Critrea1", DbType.String, IReportData.Critrea1);
            db.AddInParameter(dbCommand, "@Critrea2", DbType.String, IReportData.Critrea2);

            db.AddInParameter(dbCommand, "@ToStore", DbType.Int64, IReportData.ToStore);
            db.AddInParameter(dbCommand, "@FK_Supplier", DbType.Int64, IReportData.FK_Supplier);
            db.AddInParameter(dbCommand, "@FK_Customer", DbType.Int64, IReportData.FK_Customer);
            db.AddInParameter(dbCommand, "@FK_Salesman", DbType.Int64, IReportData.FK_Salesman);
            db.AddInParameter(dbCommand, "@PaymentMode", DbType.Byte, IReportData.PaymentMode);
            db.AddInParameter(dbCommand, "@FK_AccountHead", DbType.Int64, IReportData.FK_AccountHead);
            db.AddInParameter(dbCommand, "@FK_AccountSubHead", DbType.Int64, IReportData.FK_AccountSubHead);
            db.AddInParameter(dbCommand, "@AsonDate", DbType.Date, IReportData.AsonDate);
            db.AddInParameter(dbCommand, "@FK_AccountGroup", DbType.Int64, IReportData.FK_AccountGroup);
            db.AddInParameter(dbCommand, "@FK_AccountSubGroup", DbType.Int64, IReportData.FK_AccountSubGroup);
            db.AddInParameter(dbCommand, "@IssueMode", DbType.Byte, IReportData.IssueMode);
            db.AddInParameter(dbCommand, "@FK_Users", DbType.Int64, IReportData.FK_Users);
            db.AddInParameter(dbCommand, "@FK_Counter", DbType.Int64, IReportData.FK_Counter);
            db.AddInParameter(dbCommand, "@FK_Shift", DbType.Int64, IReportData.FK_Shift);
            db.AddInParameter(dbCommand, "@FK_CustomerGroup", DbType.Int64, IReportData.FK_CustomerGroup);
            try
            {
                ds = db.ExecuteDataSet(dbCommand);
                return(ds);
            }
            catch (SqlException e)
            {
                throw;
            }
        }
 public void Build(IReportData data)
 {
     foreach (var condition in data.Grammar.Conditions)
     {
         int i = condition.Index;
         string scanModeFileName = Path.GetFileName(fileName) + "_" + i + Path.GetExtension(fileName);
         string path = Path.Combine(data.DestinationDirectory, scanModeFileName);
         using (var graph = new GvGraphView(path))
         {
             var dfa = data.GetScannerAutomata(condition);
             dfa.DescribeGraph(graph);
         }
     }
 }
Exemplo n.º 13
0
 public void Build(IReportData data)
 {
     foreach (var condition in data.Grammar.Conditions)
     {
         int    i = condition.Index;
         string scanModeFileName = Path.GetFileName(fileName) + "_" + i + Path.GetExtension(fileName);
         string path             = Path.Combine(data.DestinationDirectory, scanModeFileName);
         using (var graph = new GvGraphView(path))
         {
             var dfa = data.GetScannerAutomata(condition);
             dfa.DescribeGraph(graph);
         }
     }
 }
Exemplo n.º 14
0
        private void ShowReport(string reportMode)
        {
            fmCRHPayedRequestReportParameters current = View.CurrentObject as fmCRHPayedRequestReportParameters;

            if (current == null)
            {
                return;
            }

            // Создаём для отчёта отдельный ObjectSpace
            IObjectSpace objectSpace = ObjectSpace;   //ObjectSpace;   // Application.CreateObjectSpace();

            /*
             * // Определяем тип объектов отчёта
             * Type dsType = typeof(fmCRHPayedRequestNonPersistent);
             *
             * // Получаем название файла (без расширения, которое всегда .repx) разметки отчёта
             * string reportFileName = "fmCRHPayedRequestReport";
             *
             * string fname = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
             * FileInfo fi = new FileInfo(fname);
             *
             * string checkDir = fi.Directory.FullName + "\\Reports\\";
             *
             * // http://www.devexpress.com/Support/Center/p/Q135993.aspx
             * //XafExtReport rep = new XafExtReport();
             * XafReport rep = new XafReport();
             * rep.LoadLayout(checkDir + reportFileName + ".repx");
             */

            /*
             * if (reportMode == "Short") {
             *  for (int i = 0; i < rep.Bands.Count; i++) {
             *      if (rep.Bands[i].Name == "detailBand1") {
             *          rep.Bands[i].Visible = false;
             *      }
             *  }
             * }
             */

            //IReportData reportData = ObjectSpace.FindObject<ReportData>(new BinaryOperator("Name", "fmCRHPayedRequestReport"));
            IReportData reportData = ObjectSpace.FindObject <ReportData>(new BinaryOperator("Name", "Список оплаченных счетов"));
            XafReport   rep        = reportData.LoadXtraReport(objectSpace);

            rep.DataSource = current.GenerateReportContent();

            //rep.ShowDesignerDialog();
            rep.ShowPreview();
        }
        private IEnumerable <IPreviousYearLearner> FilterLearners(IReportData reportData)
        {
            foreach (var learner in reportData.PreviousYearLearners ?? Array.Empty <PreviousYearLearner>())
            {
                var excluded = reportData.LARSLearningDeliveries
                               .Any(x => string.Equals(x.LearnAimRef, learner.LearnAimRef, StringComparison.OrdinalIgnoreCase) &&
                                    x.LARSLearningDeliveryCategories.Any(ldc => _excludedCategories.Contains(ldc.CategoryRef))) ||
                               FM99Exclusion(learner);

                if (!excluded)
                {
                    yield return(learner);
                }
            }
        }
Exemplo n.º 16
0
        private static StreamWriter DescribeState(
            IReportData data,
            IParserState state,
            StreamWriter output,
            string indent)
        {
            foreach (var item in state.DotItems)
            {
                output.Write(indent);
                DescribeItem(data, item, output);
                output.WriteLine();
            }

            return(output);
        }
Exemplo n.º 17
0
        public ISummaryModel Build(IReportServiceContext reportServiceContext, IReportData reportData)
        {
            var organisationNameDictionary = reportData.Organisations.ToDictionary(x => x.Ukprn, x => x.Name);
            var orgName = organisationNameDictionary.GetValueOrDefault(reportServiceContext.Ukprn);

            return(new SummaryModel
            {
                HeaderData = BuildHeader(
                    orgName,
                    reportServiceContext.Ukprn.ToString(),
                    string.Empty,
                    string.Empty,
                    ReportingConstants.OfficialSensitive)
            });
        }
Exemplo n.º 18
0
        private static StreamWriter DescribeRule(IReportData data, int ruleId, StreamWriter output)
        {
            var rule = data.Grammar.Productions[ruleId];

            output.Write(rule.Outcome.Name);
            output.Write(" ->");

            foreach (var symbol in rule.Pattern)
            {
                output.Write(" ");
                output.Write(symbol.Name);
            }

            return(output);
        }
        public void Build(IReportData data)
        {
            string path = Path.Combine(data.DestinationDirectory, fileName);

            using (var file = new StreamWriter(path, false, Encoding.UTF8))
            {
                foreach (var scanCondition in data.Grammar.Conditions)
                {
                    file.WriteLine("-------------------------------------");
                    file.WriteLine("ScanMode {0}:", scanCondition.Name);
                    foreach (var scanProduciton in scanCondition.Matchers)
                    {
                        file.WriteLine(" " + scanProduciton.ToString());
                    }
                }
            }
        }
Exemplo n.º 20
0
 public AccountController(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     RoleManager <IdentityRole <short> > roleManager,
     IWebHostEnvironment webHostEnvironment,
     IReportData reportData,
     IMessageService messageService,
     ILogService logger)
 {
     _userManager        = userManager;
     _signInManager      = signInManager;
     _roleManager        = roleManager;
     _webHostEnvironment = webHostEnvironment;
     _reportData         = reportData;
     _messageService     = messageService;
     _logger             = logger;
 }
 public ReportController(IReportData reportData, IManagerReportData adminReportData,
                         UserManager <ApplicationUser> userManager,
                         IWebHostEnvironment webHostEnvironment,
                         IManagerData managerData,
                         IMessageService messageService,
                         IProjectData projectService,
                         IActivityData activityService)
 {
     _reportData         = reportData;
     _userManager        = userManager;
     _managerReportData  = adminReportData;
     _webHostEnvironment = webHostEnvironment;
     _managerData        = managerData;
     _messageService     = messageService;
     _projectService     = projectService;
     _activityData       = activityService;
 }
Exemplo n.º 22
0
        public void Build(IReportData data)
        {
            string path = Path.Combine(data.DestinationDirectory, fileName);

            using (var file = new StreamWriter(path, false, Encoding.UTF8))
            {
                foreach (var scanCondition in data.Grammar.Conditions)
                {
                    file.WriteLine("-------------------------------------");
                    file.WriteLine("ScanMode {0}:", scanCondition.Name);
                    foreach (var scanProduciton in scanCondition.Matchers)
                    {
                        file.WriteLine(" " + scanProduciton.ToString());
                    }
                }
            }
        }
Exemplo n.º 23
0
 public AdminController(UserManager <ApplicationUser> userManager, IReportData reportData,
                        IManagerReportData managerReportData,
                        IWebHostEnvironment webHostEnvironment,
                        RoleManager <IdentityRole <short> > roleManager,
                        IManagerData managerData,
                        IMessageService messageService,
                        IProjectData projectService,
                        ILogService logger,
                        IActivityData activityData)
 {
     _userManager        = userManager;
     _reportData         = reportData;
     _managerReportData  = managerReportData;
     _webHostEnvironment = webHostEnvironment;
     _roleManager        = roleManager;
     _managerData        = managerData;
     _messageService     = messageService;
     _projectData        = projectService;
     _logger             = logger;
     _activityData       = activityData;
 }
Exemplo n.º 24
0
        private void ReportConflict(IReportData data, ParserConflictInfo conflict, StreamWriter message)
        {
            var symbol = data.Grammar.Symbols[conflict.Token];

            const string Indent = "  ";

            message.WriteLine(new string('-', 50));
            message.Write("Conflict on token ");
            message.Write(symbol.Name);
            message.Write(" between actions in state #");
            message.Write(conflict.State + "");
            message.WriteLine(":");
            DescribeState(data, conflict.State, message, Indent).WriteLine();
            for (int i = 0; i != conflict.Actions.Count; ++i)
            {
                message.WriteLine("Action #{0}", i);
                DescribeAction(data, conflict.Actions[i], message, Indent);
            }

            message.WriteLine(new string('-', 50));
        }
Exemplo n.º 25
0
        public void Build(IReportData data)
        {
            string path = Path.Combine(data.DestinationDirectory, fileName);

            var conflicts = data.ParserAutomata.Conflicts;

            using (var writer = new StreamWriter(path, false, Encoding.UTF8))
            {
                if (conflicts.Count != 0)
                {
                    writer.WriteLine("Found {0} conflicts", conflicts.Count);

                    foreach (var conflict in conflicts)
                    {
                        ReportConflict(data, conflict, writer);
                    }
                }

                PrintTransitions(data, writer);
            }
        }
        public void Build(IReportData data)
        {
            string path = Path.Combine(data.DestinationDirectory, fileName);

            var conflicts = data.ParserAutomata.Conflicts;

            using (var writer = new StreamWriter(path, false, Encoding.UTF8))
            {
                if (conflicts.Count != 0)
                {
                    writer.WriteLine("Found {0} conflicts", conflicts.Count);

                    foreach (var conflict in conflicts)
                    {
                        ReportConflict(data, conflict, writer);
                    }
                }

                PrintTransitions(data, writer);
            }
        }
Exemplo n.º 27
0
        private StreamWriter DescribeAction(
            IReportData data,
            ParserAction action,
            StreamWriter output,
            string indent)
        {
            switch (action.Kind)
            {
            case ParserActionKind.Shift:
                output.Write(indent);
                output.Write("Shift to the state I");
                output.Write(action.State + "");
                output.WriteLine(":");
                DescribeState(data, action.State, output, indent + indent);
                break;

            case ParserActionKind.ShiftReduce:
                output.Write(indent);
                output.WriteLine("Shift-Reduce on the rule:");
                output.Write(indent + indent);
                DescribeRule(data, action.ProductionId, output);
                output.WriteLine();
                break;

            case ParserActionKind.Reduce:
                output.Write(indent);
                output.WriteLine("Reduce on the rule:");
                output.Write(indent + indent);
                DescribeRule(data, action.ProductionId, output);
                output.WriteLine();
                break;

            case ParserActionKind.Accept:
                output.Write(indent);
                output.WriteLine("Accept.");
                break;
            }

            return(output);
        }
Exemplo n.º 28
0
        private static StreamWriter DescribeItem(
            IReportData data,
            IParserDotItem item,
            StreamWriter output,
            bool showLookaheads = true)
        {
            var production = item.Production;

            output.Write(production.Outcome.Name);
            output.Write(" ->");
            int i = 0;

            foreach (var symbol in production.Pattern)
            {
                if (item.Position == i)
                {
                    output.Write(" •");
                }

                output.Write(" ");
                output.Write(symbol.Name);

                ++i;
            }

            if (item.Position == production.PatternTokens.Length)
            {
                output.Write(" •");
            }

            if (showLookaheads)
            {
                output.Write("  |LA = {");
                output.Write(string.Join(", ", (from la in item.LA select data.Grammar.Symbols[la].Name)));
                output.Write("}");
            }

            return(output);
        }
Exemplo n.º 29
0
        private void Inicialize()
        {
            IReportData source = this.currentReport.DataSources.GetSource(this.currentReport.MasterDataSource);

            if (source != null)
            {
                this.fields = source.Fields;
                this.comboFields.Items.Clear();
                if (this.fields.Length > 0)
                {
                    foreach (ReportDataFieldInfo info in this.fields)
                    {
                        this.comboFields.Items.Add(info.FieldName);
                    }
                    this.comboFields.SelectedIndex = 0;
                }
                this.listGroups.Items.Clear();
                foreach (BandGroup group in this.currentReport.BandsGroup)
                {
                    this.listGroups.Items.Add(group.FieldName);
                }
            }
        }
        private static StreamWriter DescribeItem(
            IReportData     data,
            IParserDotItem  item,
            StreamWriter    output,
            bool showLookaheads = true)
        {
            var production = item.Production;
            output.Write(production.Outcome.Name);
            output.Write(" ->");
            int i = 0;
            foreach (var symbol in production.Pattern)
            {
                if (item.Position == i)
                {
                    output.Write(" •");
                }

                output.Write(" ");
                output.Write(symbol.Name);

                ++i;
            }

            if (item.Position == production.PatternTokens.Length)
            {
                output.Write(" •");
            }

            if (showLookaheads)
            {
                output.Write("  |LA = {");
                output.Write(string.Join(", ", (from la in item.LA select data.Grammar.Symbols[la].Name)));
                output.Write("}");
            }

            return output;
        }
Exemplo n.º 31
0
 private void ReportPrintStart()
 {
     this.dataSource = base.dataSources.GetSource(this.MasterDataSource);
     if (this.dataSource != null)
     {
         this.dataSource.OpenDataSouce();
         this.dataSource.DataSourceFirstRecord();
     }
     else
     {
         this.dataSource = new ReportDataTable();
     }
     this.InitializeDataLink();
     this.InitializeCalcField();
     this.PrepareGroups();
     this.SortControls();
     base.ConfigurePaperSize();
     this.printTitle = true;
     this.pagecount  = 1;
     if (this.ReportStart != null)
     {
         this.ReportStart();
     }
 }
Exemplo n.º 32
0
        protected override ResultStatus Export()
        {
            try {
                #region 輸入&日期檢核
                if (string.Compare(txtStartMonth.Text, txtEndMonth.Text) > 0)
                {
                    MessageDisplay.Error("月份起始年月不可小於迄止年月!", GlobalInfo.ErrorText);
                    return(ResultStatus.Fail);
                }

                if (string.Compare(txtStartDate.Text, txtEndDate.Text) > 0)
                {
                    MessageDisplay.Error(CheckDate.Datedif, GlobalInfo.ErrorText);
                    return(ResultStatus.Fail);
                }
                #endregion

                //1.開始轉出資料
                panFilter.Enabled = false;
                labMsg.Visible    = true;
                labMsg.Text       = "訊息:資料轉出中........";
                this.Refresh();


                //1.1 copy template xls to target path
                string   excelDestinationPath = PbFunc.wf_copy_file(_ProgramID, _ProgramID);
                Workbook workbook             = new Workbook();
                workbook.LoadDocument(excelDestinationPath);

                #region //ken,第一次改寫(廢除)
                //if (chkGroup.Items[1].CheckState == System.Windows.Forms.CheckState.Checked) {
                //   if (rdoGroup.Text == "期貨" || rdoGroup.Text == "全部")
                //      wf_30770_date(workbook, "F%", SheetType.FutureDetail, StartDate, EndDate, OswGrp);//sheetName = 期貨日明細

                //   if (rdoGroup.Text == "選擇權" || rdoGroup.Text == "全部")
                //      wf_30770_date(workbook, "O%", SheetType.FutureDetail, StartDate, EndDate, OswGrp);//sheetName = 選擇權日明細
                //}//if (chkGroup.Items[1].CheckState == System.Windows.Forms.CheckState.Checked) {

                //if (chkGroup.Items[0].CheckState == System.Windows.Forms.CheckState.Checked) {
                //   if (rdoGroup.Text == "期貨" || rdoGroup.Text == "全部")
                //      wf_30770_mth(workbook, "F%", SheetType.FutureSum, StartDate, EndDate, OswGrp);//sheetName = 期貨月統計

                //   if (rdoGroup.Text == "選擇權" || rdoGroup.Text == "全部")
                //      wf_30770_mth(workbook, "O%", SheetType.OptionSum, StartDate, EndDate, OswGrp);//sheetName = 選擇權月統計
                //}//if (chkGroup.Items[0].CheckState == System.Windows.Forms.CheckState.Checked) {
                #endregion

                //2.匯出資料(看勾選情況,目前最多跑2x2=4次)
                Object[] args = { dao30770, _ProgramID, StartMonth, EndMonth, StartDate, EndDate, OswGrp, OswGrpText };

                int pos = 0;
                foreach (CheckedListBoxItem chk in chkGroup.Items)
                {
                    if (chk.CheckState == CheckState.Checked)
                    {
                        if (rdoGroup.Text == "%")
                        {
                            //全部,兩個都要跑
                            IReportData Future = CreateReport(GetType(), "Future" + chk.Value.ToString(), args);
                            pos += Future.Export(workbook);

                            IReportData Option = CreateReport(GetType(), "Option" + chk.Value.ToString(), args);
                            pos += Option.Export(workbook);
                        }
                        else
                        {
                            IReportData ReportData = CreateReport(GetType(), rdoGroup.Text + chk.Value.ToString(), args);
                            pos += ReportData.Export(workbook);
                        } //if (rdoGroup.Text == "%") {
                    }     //if(chk.CheckState == CheckState.Checked){
                }         //foreach(CheckedListBoxItem chk in chkGroup.Items){

                if (pos <= 0)
                {
                    File.Delete(excelDestinationPath);
                    MessageDisplay.Info("查無資料!", GlobalInfo.ResultText);
                    return(ResultStatus.Fail);
                }

                //存檔
                workbook.SaveDocument(excelDestinationPath);

                //if (FlagAdmin)
                //   System.Diagnostics.Process.Start(excelDestinationPath);

                return(ResultStatus.Success);
            } catch (Exception ex) {
                WriteLog(ex);
            } finally {
                panFilter.Enabled = true;
                labMsg.Text       = "";
                labMsg.Visible    = false;
            }
            return(ResultStatus.Fail);
        }
        protected override void ShowInReport(SingleChoiceActionExecuteEventArgs e, IReportData reportData)
        {
            if (View is DevExpress.ExpressApp.ListView)
            {
                DevExpress.Persistent.BaseImpl.ReportData currentReportData = ObjectSpace.GetObject<DevExpress.Persistent.BaseImpl.ReportData>((DevExpress.Persistent.BaseImpl.ReportData)reportData);

                using (XtraReport report = currentReportData.LoadReport(ObjectSpace))
                {
                    string dataFilterCaption = String.Empty;
                    CustomFilterController filterController = Frame.GetController<CustomFilterController>();
                    if (filterController != null)
                    {
                        var filter = filterController.SetFilterAction.SelectedItem;
                        if (filter != null)
                            dataFilterCaption = filter.Caption;
                    }

                    string gridFilterCaption = String.Empty;
                    ListView view = View as ListView;
                    if (view != null)
                    {
                        GridListEditor listEditor = view.Editor as GridListEditor;

                        if (listEditor != null)
                        {
                            gridFilterCaption = listEditor.GridView.FilterPanelText;
                            //string filterCaption = String.Format("{0}: {1}\n{2}",  CaptionHelper.GetLocalizedText("Captions", "Filter"), dataFilterCaption, gridFilterCaption);

                            string reportCapture = CaptionHelper.GetLocalizedText(@"Enums\BuiltInReports", currentReportData.ReportName);
                            ReportCommonMethods.PopulateHeaderLabels(report, reportCapture, dataFilterCaption, gridFilterCaption);
                            // передаем в отчет данные в том виде, как они представленны в GridView
                            // т.е со всеми фильтрами и сортировками
                            report.DataSource = listEditor.GetOrderedObjects();
                        }
                    }

                    report.ShowPreviewDialog();
                }
            }
            else if (View is DevExpress.ExpressApp.DetailView)
            {
                DevExpress.Persistent.BaseImpl.ReportData currentReportData = ObjectSpace.GetObject<DevExpress.Persistent.BaseImpl.ReportData>((DevExpress.Persistent.BaseImpl.ReportData)reportData);
                using (XtraReport report = currentReportData.LoadReport(ObjectSpace))
                {
                    string reportCapture = CaptionHelper.GetLocalizedText(@"Enums\BuiltInReports", currentReportData.ReportName);
                    ReportCommonMethods.PopulateHeaderLabels(report, reportCapture, String.Empty, String.Empty);

                    CriteriaOperator criteria = CriteriaOperator.Parse("Oid = ?", View.ObjectSpace.GetKeyValue(View.CurrentObject));
                    report.DataSource = View.ObjectSpace.GetObjects(View.ObjectTypeInfo.Type, criteria);

                    //XRRichText rtfEdit = report.FindControl("ConclusionRichText", true) as XRRichText;
                    //if (rtfEdit != null)
                    //{
                    //    MitsarDataStudio.Module.DC.IExamination examination = View.CurrentObject as MitsarDataStudio.Module.DC.IExamination;
                    //    if (examination != null)
                    //        rtfEdit.LoadFile(examination.ConclusionFile.RealFileName);
                    //}

                    report.ShowPreviewDialog();
                }
            }
            else
            {
                base.ShowInReport(e, reportData);
            }
        }
Exemplo n.º 34
0
 public LrGraph(IReportData data)
 {
     this.grammar  = data.Grammar;
     this.automata = data.ParserAutomata;
 }
        public IEnumerable <Frm06ReportModel> Build(IReportServiceContext reportServiceContext, IReportData reportData)
        {
            var models = new List <Frm06ReportModel>();

            var organisationNameDictionary = reportData.Organisations.ToDictionary(x => x.Ukprn, x => x.Name);
            var learnAimDictionary         = reportData.LARSLearningDeliveries.ToDictionary(x => x.LearnAimRef, x => x, StringComparer.OrdinalIgnoreCase);

            var currentLearnersHashSet = BuildCurrentYearLearnerHashSet(reportData.Learners);

            var returnPeriod = reportServiceContext.ReturnPeriodName;

            foreach (var learner in FilterLearners(reportData))
            {
                var key = new LearnerKey
                {
                    FworkCodeNullable = learner.FworkCodeNullable,
                    LearnAimRef       = learner.LearnAimRef,
                    LearnRefNumber    = learner.LearnRefNumber,
                    LearnStartDate    = learner.LearnStartDate,
                    ProgTypeNullable  = learner.ProgTypeNullable
                };

                if (!currentLearnersHashSet.Contains(key))
                {
                    var advancedLoansIndicator = RetrieveFamCodeForType(learner.LearningDeliveryFAMs, ADLLearnDelFamType);
                    var resIndicator           = RetrieveFamCodeForType(learner.LearningDeliveryFAMs, RESLearnDelFamType);
                    var sofCode     = RetrieveFamCodeForType(learner.LearningDeliveryFAMs, SOFLearnDelFamType);
                    var pmOrgName   = organisationNameDictionary.GetValueOrDefault(Convert.ToInt32(learner.PMUKPRN.GetValueOrDefault()));
                    var prevOrgName = organisationNameDictionary.GetValueOrDefault(Convert.ToInt32(learner.PrevUKPRN.GetValueOrDefault()));
                    var learnAim    = learnAimDictionary.GetValueOrDefault(learner.LearnAimRef);

                    models.Add(new Frm06ReportModel
                    {
                        UKPRN              = learner.UKPRN,
                        PrevOrgName        = prevOrgName,
                        PMOrgName          = pmOrgName,
                        AimTypeCode        = learner.AimType,
                        LearningAimType    = learnAim?.LearnAimRefTypeDesc,
                        FundingModel       = learner.FundModel,
                        OrigLearnStartDate = learner.OrigLearnStartDate,
                        SOFCode            = sofCode,
                        Return             = returnPeriod,
                        OrgName            = learner.OrgName,
                        FworkCode          = learner.FworkCodeNullable,
                        LearnAimTitle      = learnAim?.LearnAimRefTitle,
                        LearnAimRef        = learner.LearnAimRef,
                        LearnRefNumber     = learner.LearnRefNumber,
                        LearnStartDate     = learner.LearnStartDate,
                        ProgType           = learner.ProgTypeNullable,
                        StdCode            = learner.StdCodeNullable,
                        ULN = learner.ULN,
                        AdvancedLoansIndicator = advancedLoansIndicator,
                        AimSeqNumber           = learner.AimSeqNumber,
                        CompStatus             = learner.CompStatus,
                        LearnActEndDate        = learner.LearnActEndDate,
                        LearnPlanEndDate       = learner.LearnPlanEndDate,
                        OtherFundAdj           = learner.OtherFundAdj,
                        Outcome             = learner.Outcome,
                        PMUKPRN             = learner.PMUKPRN,
                        PartnerUKPRN        = learner.PartnerUKPRN,
                        PartnerOrgName      = learner.PartnerOrgName,
                        PriorLearnFundAdj   = learner.PriorLearnFundAdj,
                        PrevUKPRN           = learner.PrevUKPRN,
                        PwayCode            = learner.PwayCodeNullable,
                        ResIndicator        = resIndicator,
                        SWSupAimId          = learner.SWSupAimId,
                        ProvSpecLearnDelMon = BuildProvSpecLearnDelMons(learner?.ProvSpecDeliveryMonitorings),
                        ProvSpecDelMon      = BuildProvSpecLearnDelMons(learner?.ProviderSpecLearnerMonitorings)
                    });
                }
            }

            return(models);
        }
Exemplo n.º 36
0
 public LrGraph(IReportData data)
 {
     this.grammar  = data.Grammar;
     this.automata = data.ParserAutomata;
 }
Exemplo n.º 37
0
 internal byte[] GenerateReport(IReportData data)
 {
     return(_reportEngine.GenerateReport(data));
 }
 private static StreamWriter DescribeState(
     IReportData data,
     int state,
     StreamWriter output,
     string indent)
 {
     var automata = data.ParserAutomata;
     return DescribeState(data, automata.States[state], output, indent);
 }
        private static StreamWriter DescribeRule(IReportData data, int ruleId, StreamWriter output)
        {
            var rule = data.Grammar.Productions[ruleId];

            output.Write(rule.Outcome.Name);
            output.Write(" ->");

            foreach (var symbol in rule.Pattern)
            {
                output.Write(" ");
                output.Write(symbol.Name);
            }

            return output;
        }
        private static StreamWriter DescribeState(
            IReportData data,
            IParserState state,
            StreamWriter output,
            string indent)
        {
            foreach (var item in state.DotItems)
            {
                output.Write(indent);
                DescribeItem(data, item, output);
                output.WriteLine();
            }

            return output;
        }
        private void ReportConflict(IReportData data, ParserConflictInfo conflict, StreamWriter message)
        {
            var symbol = data.Grammar.Symbols[conflict.Token];

            const string Indent = "  ";

            message.WriteLine(new string('-', 50));
            message.Write("Conflict on token ");
            message.Write(symbol.Name);
            message.Write(" between actions in state #");
            message.Write(conflict.State + "");
            message.WriteLine(":");
            DescribeState(data, conflict.State, message, Indent).WriteLine();
            for (int i = 0; i != conflict.Actions.Count; ++i)
            {
                message.WriteLine("Action #{0}", i);
                DescribeAction(data, conflict.Actions[i], message, Indent);
            }

            message.WriteLine(new string('-', 50));
        }
        private void PrintTransitions(IReportData data, StreamWriter output)
        {
            string title = "Language: " + data.Source.FullLanguageName;

            output.WriteLine(title);
            output.WriteLine();
            output.WriteLine("Grammar:");
            output.Write(data.Grammar);
            output.WriteLine();

            foreach (var state in data.ParserAutomata.States)
            {
                output.Write("State ");
                output.Write(state.Index);
                output.WriteLine();
                output.WriteLine();
                DescribeState(data, state, output, Indent);
                output.WriteLine();

                foreach (var transition in state.Transitions)
                {
                    var actions = transition.Actions;
                    int count = actions.Count();

                    var symbol = data.Grammar.Symbols[transition.Token];

                    if (count == 0)
                    {
                    }
                    else if (count > 1)
                    {
                        output.Write(Indent);
                        output.WriteLine("conflict {");
                        foreach (var action in actions)
                        {
                            PrintAction(data, symbol, output, action);
                        }

                        output.Write(Indent);
                        output.WriteLine("}");
                        output.WriteLine();
                    }
                    else
                    {
                        PrintAction(data, symbol, output, actions.Single());
                    }
                }

                output.WriteLine();
            }
        }
        private void PrintAction(IReportData data, SymbolBase symbol, StreamWriter output, ParserAction action)
        {
            if (action == null || action.Kind == ParserActionKind.Fail)
            {
                return;
            }

            output.Write(Indent);
            output.Write(symbol.Name);
            output.Write("             ");
            switch (action.Kind)
            {
                case ParserActionKind.Shift:
                    output.Write("shift and go to state ");
                    output.Write(action.State);
                    break;
                case ParserActionKind.Reduce:
                    output.Write("reduce using rule ");
                    output.Write(action.ProductionId);
                    break;
                case ParserActionKind.ShiftReduce:
                    output.Write("shift-reduce using rule ");
                    output.Write(action.ProductionId);
                    break;
                case ParserActionKind.Accept:
                    output.WriteLine("accept");
                    break;
            }

            output.WriteLine();
        }
        private StreamWriter DescribeAction(
            IReportData data,
            ParserAction action,
            StreamWriter output,
            string indent)
        {
            switch (action.Kind)
            {
                case ParserActionKind.Shift:
                    output.Write(indent);
                    output.Write("Shift to the state I");
                    output.Write(action.State + "");
                    output.WriteLine(":");
                    DescribeState(data, action.State, output, indent + indent);
                    break;
                case ParserActionKind.ShiftReduce:
                    output.Write(indent);
                    output.WriteLine("Shift-Reduce on the rule:");
                    output.Write(indent + indent);
                    DescribeRule(data, action.ProductionId, output);
                    output.WriteLine();
                    break;
                case ParserActionKind.Reduce:
                    output.Write(indent);
                    output.WriteLine("Reduce on the rule:");
                    output.Write(indent + indent);
                    DescribeRule(data, action.ProductionId, output);
                    output.WriteLine();
                    break;
                case ParserActionKind.Accept:
                    output.Write(indent);
                    output.WriteLine("Accept.");
                    break;
            }

            return output;
        }