コード例 #1
0
 internal virtual void Reset(ReportSection section, int newPageNumber, int newTotalPages, int newOverallPageNumber, int newOverallTotalPages)
 {
     m_currentPageNumber        = newPageNumber;
     m_totalPages               = newTotalPages;
     m_currentOverallPageNumber = newOverallPageNumber;
     m_overallTotalPages        = newOverallTotalPages;
 }
コード例 #2
0
 public INCCStyleSection(System.Type column, short prelines, ReportSection sec = ReportSection.Standard)
     : base(column, prelines)
 {
     this.sectiontype = sec;
     scientific       = "{0,15:e}";
     SetFPCurrentFormatPrecision(N.App.AppContext.FPPrecision);
 }
コード例 #3
0
 public INCCStyleSection(System.Type column, short prelines, ReportSection sec = ReportSection.Standard)
     : base(column, prelines)
 {
     this.sectiontype = sec;
     scientific = "{0,15:e}";
     SetFPCurrentFormatPrecision(N.App.AppContext.FPPrecision);
 }
コード例 #4
0
 public virtual void Reset(ReportSection section, int newPageNumber, int newTotalPages, int newOverallPageNumber, int newOverallTotalPages)
 {
     this.m_currentPageNumber        = newPageNumber;
     this.m_totalPages               = newTotalPages;
     this.m_currentOverallPageNumber = newOverallPageNumber;
     this.m_overallTotalPages        = newOverallTotalPages;
 }
コード例 #5
0
 private void AddWarehouseMaterials(StringBuilder sb, ReportSection s)
 {
     foreach (var m in s.Materials.OrderBy(x => x.Key))
     {
         sb.AppendLine($"{m.Key}: {m.Value}");
     }
 }
コード例 #6
0
        public void ReportSection_Controller_Put_Test()
        {
            foreach (LanguageEnum LanguageRequest in AllowableLanguages)
            {
                foreach (int ContactID in new List <int>()
                {
                    AdminContactID
                })                                                             //, TestEmailValidatedContactID, TestEmailNotValidatedContactID })
                {
                    ReportSectionController reportSectionController = new ReportSectionController(DatabaseTypeEnum.SqlServerTestDB);
                    Assert.IsNotNull(reportSectionController);
                    Assert.AreEqual(DatabaseTypeEnum.SqlServerTestDB, reportSectionController.DatabaseType);

                    ReportSection reportSectionLast = new ReportSection();
                    using (CSSPDBContext db = new CSSPDBContext(DatabaseType))
                    {
                        Query query = new Query();
                        query.Language = LanguageRequest;

                        ReportSectionService reportSectionService = new ReportSectionService(query, db, ContactID);
                        reportSectionLast = (from c in db.ReportSections select c).FirstOrDefault();
                    }

                    // ok with ReportSection info
                    IHttpActionResult jsonRet = reportSectionController.GetReportSectionWithID(reportSectionLast.ReportSectionID);
                    Assert.IsNotNull(jsonRet);

                    OkNegotiatedContentResult <ReportSection> Ret = jsonRet as OkNegotiatedContentResult <ReportSection>;
                    ReportSection reportSectionRet = Ret.Content;
                    Assert.AreEqual(reportSectionLast.ReportSectionID, reportSectionRet.ReportSectionID);

                    BadRequestErrorMessageResult badRequest = jsonRet as BadRequestErrorMessageResult;
                    Assert.IsNull(badRequest);

                    // Put to return success
                    IHttpActionResult jsonRet2 = reportSectionController.Put(reportSectionRet, LanguageRequest.ToString());
                    Assert.IsNotNull(jsonRet2);

                    OkNegotiatedContentResult <ReportSection> reportSectionRet2 = jsonRet2 as OkNegotiatedContentResult <ReportSection>;
                    Assert.IsNotNull(reportSectionRet2);

                    BadRequestErrorMessageResult badRequest2 = jsonRet2 as BadRequestErrorMessageResult;
                    Assert.IsNull(badRequest2);

                    // Put to return CSSPError because ReportSectionID of 0 does not exist
                    reportSectionRet.ReportSectionID = 0;
                    IHttpActionResult jsonRet3 = reportSectionController.Put(reportSectionRet, LanguageRequest.ToString());
                    Assert.IsNotNull(jsonRet3);

                    OkNegotiatedContentResult <ReportSection> reportSectionRet3 = jsonRet3 as OkNegotiatedContentResult <ReportSection>;
                    Assert.IsNull(reportSectionRet3);

                    BadRequestErrorMessageResult badRequest3 = jsonRet3 as BadRequestErrorMessageResult;
                    Assert.IsNotNull(badRequest3);
                }
            }
        }
コード例 #7
0
        private ReportSection GetFilledRandomReportSection(string OmitPropName)
        {
            ReportSection reportSection = new ReportSection();

            if (OmitPropName != "ReportTypeID")
            {
                reportSection.ReportTypeID = 1;
            }
            // Need to implement (no items found, would need to add at least one in the TestDB) [ReportSection TVItemID TVItem TVItemID]
            if (OmitPropName != "Language")
            {
                reportSection.Language = LanguageRequest;
            }
            if (OmitPropName != "Ordinal")
            {
                reportSection.Ordinal = GetRandomInt(0, 1000);
            }
            if (OmitPropName != "IsStatic")
            {
                reportSection.IsStatic = true;
            }
            if (OmitPropName != "ParentReportSectionID")
            {
                reportSection.ParentReportSectionID = 1;
            }
            if (OmitPropName != "Year")
            {
                reportSection.Year = GetRandomInt(1979, 2050);
            }
            if (OmitPropName != "Locked")
            {
                reportSection.Locked = true;
            }
            if (OmitPropName != "TemplateReportSectionID")
            {
                reportSection.TemplateReportSectionID = 1;
            }
            if (OmitPropName != "ReportSectionName")
            {
                reportSection.ReportSectionName = GetRandomString("", 5);
            }
            if (OmitPropName != "ReportSectionText")
            {
                reportSection.ReportSectionText = GetRandomString("", 5);
            }
            if (OmitPropName != "LastUpdateDate_UTC")
            {
                reportSection.LastUpdateDate_UTC = new DateTime(2005, 3, 6);
            }
            if (OmitPropName != "LastUpdateContactTVItemID")
            {
                reportSection.LastUpdateContactTVItemID = 2;
            }

            return(reportSection);
        }
コード例 #8
0
 /// <summary>
 /// Extracts all tables from a report section
 /// </summary>
 /// <param name="section">The report section</param>
 /// <returns>A collection of tables</returns>
 private IEnumerable <Table> ExtractTables
 (
     ReportSection section
 )
 {
     return(ExtractTables
            (
                section.Components
            ));
 }
コード例 #9
0
        public void ReportSection_CRUD_Test()
        {
            foreach (CultureInfo culture in AllowableCulture)
            {
                ChangeCulture(culture);

                using (CSSPDBContext dbTestDB = new CSSPDBContext(DatabaseTypeEnum.SqlServerTestDB))
                {
                    ReportSectionService reportSectionService = new ReportSectionService(new Query()
                    {
                        Lang = culture.TwoLetterISOLanguageName
                    }, dbTestDB, ContactID);

                    int count = 0;
                    if (count == 1)
                    {
                        // just so we don't get a warning during compile [The variable 'count' is assigned but its value is never used]
                    }

                    ReportSection reportSection = GetFilledRandomReportSection("");

                    // -------------------------------
                    // -------------------------------
                    // CRUD testing
                    // -------------------------------
                    // -------------------------------

                    count = reportSectionService.GetReportSectionList().Count();

                    Assert.AreEqual(count, (from c in dbTestDB.ReportSections select c).Count());

                    reportSectionService.Add(reportSection);
                    if (reportSection.HasErrors)
                    {
                        Assert.AreEqual("", reportSection.ValidationResults.FirstOrDefault().ErrorMessage);
                    }
                    Assert.AreEqual(true, reportSectionService.GetReportSectionList().Where(c => c == reportSection).Any());
                    reportSectionService.Update(reportSection);
                    if (reportSection.HasErrors)
                    {
                        Assert.AreEqual("", reportSection.ValidationResults.FirstOrDefault().ErrorMessage);
                    }
                    Assert.AreEqual(count + 1, reportSectionService.GetReportSectionList().Count());
                    reportSectionService.Delete(reportSection);
                    if (reportSection.HasErrors)
                    {
                        Assert.AreEqual("", reportSection.ValidationResults.FirstOrDefault().ErrorMessage);
                    }
                    Assert.AreEqual(count, reportSectionService.GetReportSectionList().Count());
                }
            }
        }
コード例 #10
0
        private async Task setCondition(TankSummaryReader tsr, ReportSection section, string areaName)
        {
            //create the userId's in here
            ReportArea ra = tsr.getReport(section, areaName);

            if (ra != null)
            {
                string prefix = "ctl00_ContentPlaceHolder1_";
                await setDropdown(string.Format("{0}cmbPriority{1}", prefix, areaName.Replace(" ", string.Empty)), ra.ratingInt);
                await setDropdown(string.Format("{0}cmbStatus{1}", prefix, areaName.Replace(" ", string.Empty)), ra.ratingLetter);
                await setText(string.Format("{0}txtComment{1}", prefix, areaName.Replace(" ", string.Empty)), ra.comment);
            }
        }
コード例 #11
0
        internal void UpgradeReport(Report2008 report)
        {
            ReportSection reportSection = new ReportSection();

            reportSection.Body    = report.Body;
            reportSection.Page    = report.Page;
            reportSection.Width   = report.Width;
            report.ReportSections = new List <ReportSection>(1);
            report.ReportSections.Add(reportSection);
            report.Body  = null;
            report.Page  = null;
            report.Width = ReportSize.Empty;
        }
コード例 #12
0
        public IHttpActionResult GetReportSectionWithID([FromUri] int ReportSectionID, [FromUri] string lang = "en", [FromUri] string extra = "")
        {
            using (CSSPDBContext db = new CSSPDBContext(DatabaseType))
            {
                ReportSectionService reportSectionService = new ReportSectionService(new Query()
                {
                    Language = (lang == "fr" ? LanguageEnum.fr : LanguageEnum.en)
                }, db, ContactID);

                reportSectionService.Query = reportSectionService.FillQuery(typeof(ReportSection), lang, 0, 1, "", "", extra);

                if (reportSectionService.Query.Extra == "A")
                {
                    ReportSectionExtraA reportSectionExtraA = new ReportSectionExtraA();
                    reportSectionExtraA = reportSectionService.GetReportSectionExtraAWithReportSectionID(ReportSectionID);

                    if (reportSectionExtraA == null)
                    {
                        return(NotFound());
                    }

                    return(Ok(reportSectionExtraA));
                }
                else if (reportSectionService.Query.Extra == "B")
                {
                    ReportSectionExtraB reportSectionExtraB = new ReportSectionExtraB();
                    reportSectionExtraB = reportSectionService.GetReportSectionExtraBWithReportSectionID(ReportSectionID);

                    if (reportSectionExtraB == null)
                    {
                        return(NotFound());
                    }

                    return(Ok(reportSectionExtraB));
                }
                else
                {
                    ReportSection reportSection = new ReportSection();
                    reportSection = reportSectionService.GetReportSectionWithReportSectionID(ReportSectionID);

                    if (reportSection == null)
                    {
                        return(NotFound());
                    }

                    return(Ok(reportSection));
                }
            }
        }
コード例 #13
0
        ReportTemplate generateSimpleTemplate()
        {
            var template = new ReportTemplate();

            template.InitializeColumns(75, 300, 50, 100);

            var header = new ReportSection();

            template.Header = header;
            var currentrow = header.AddRow();

            currentrow.AddLabel("Product List", new Font("Arial", 12, FontStyle.Bold));

            currentrow = header.AddRow();
            currentrow.AddLabel("Date Printed :");
            currentrow.AddLabel(string.Format("{0:MMM dd, yyyy}", DateTime.Now));

            header.AddRow().AddLabel(" "); //blank row

            currentrow = header.AddRow();
            var headerStyle = new TextBaseStyle()
            {
                Color     = "White",
                BackColor = "#0063B1",
                Bold      = true
            };

            currentrow.AddLabel("Product Id", headerStyle);
            currentrow.AddLabel("Product Name", headerStyle);
            currentrow.AddLabel("Quantity", headerStyle.Align(StringAlignment.Far));
            currentrow.AddLabel("Price", headerStyle.Align(StringAlignment.Far));

            var details = template.AddSection();

            details.DataSource = "products";

            currentrow = details.AddRow();
            var numberStyle = new TextBaseStyle()
            {
                Alignment = StringAlignment.Far
            };

            currentrow.AddDataField("ProductId");
            currentrow.AddDataField("ProductName");
            currentrow.AddDataField("Quantity", numberStyle, "N2");
            currentrow.AddDataField("Price", numberStyle, "N2");
            return(template);
        }
コード例 #14
0
 private static OnDemandProcessingContext InitializeSubReport(OnDemandProcessingContext parentOdpContext, AspNetCore.ReportingServices.ReportIntermediateFormat.SubReport subReport, AspNetCore.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, bool inDataRegion, bool fromCreateSubReportInstance, out bool prefetchSuccess)
 {
     Global.Tracer.Assert(null != subReport.OdpContext, "(null != subReport.OdpContext)");
     prefetchSuccess = true;
     if (!inDataRegion)
     {
         IReference <AspNetCore.ReportingServices.ReportIntermediateFormat.SubReportInstance> reference2 = subReport.CurrentSubReportInstance = ((subReport.OdpContext.SnapshotProcessing && !subReport.OdpContext.ReprocessSnapshot) ? reportInstance.SubreportInstances[subReport.IndexInCollection] : AspNetCore.ReportingServices.ReportIntermediateFormat.SubReportInstance.CreateInstance(reportInstance, subReport, parentOdpContext.OdpMetadata));
         if (!fromCreateSubReportInstance)
         {
             ReportSection containingSection = subReport.GetContainingSection(parentOdpContext);
             parentOdpContext.SetupContext(containingSection, null);
         }
         Merge merge = new Merge(subReport.Report, subReport.OdpContext);
         prefetchSuccess = merge.InitAndSetupSubReport(subReport);
     }
     return(subReport.OdpContext);
 }
コード例 #15
0
        public bool Update(ReportSection reportSection)
        {
            reportSection.ValidationResults = Validate(new ValidationContext(reportSection), ActionDBTypeEnum.Update);
            if (reportSection.ValidationResults.Count() > 0)
            {
                return(false);
            }

            db.ReportSections.Update(reportSection);

            if (!TryToSave(reportSection))
            {
                return(false);
            }

            return(true);
        }
コード例 #16
0
        private bool TryToSave(ReportSection reportSection)
        {
            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException ex)
            {
                reportSection.ValidationResults = new List <ValidationResult>()
                {
                    new ValidationResult(ex.Message + (ex.InnerException != null ? " Inner: " + ex.InnerException.Message : ""))
                }.AsEnumerable();
                return(false);
            }

            return(true);
        }
コード例 #17
0
 void RenderSection(ReportSection section)
 {
     if (!string.IsNullOrEmpty(section.DataSource))
     {
         if (this._datasource.ContainsKey(section.DataSource))
         {
             foreach (var datarow in this._datasource[section.DataSource])
             {
                 RenderRows(section.Rows.Select(row => row.ParseDataFields(datarow)));
             }
         }
     }
     else
     {
         RenderRows(section.Rows);
     }
 }
コード例 #18
0
 void RenderSection(ReportSection section)
 {
     if (!string.IsNullOrEmpty(section.DataSource))
     {
         if (this._datasource.ContainsKey(section.DataSource) &&
             this._datasource[section.DataSource] != null)
         {
             var lastValues = new Dictionary <string, string>();
             foreach (var datarow in this._datasource[section.DataSource])
             {
                 RenderRows(section.Rows.Select(row => row.FromData(datarow, lastValues)));
             }
         }
     }
     else
     {
         RenderRows(section.Rows);
     }
 }
コード例 #19
0
        public void ReportSection_Controller_GetReportSectionWithID_Test()
        {
            foreach (LanguageEnum LanguageRequest in AllowableLanguages)
            {
                foreach (int ContactID in new List <int>()
                {
                    AdminContactID
                })                                                             //, TestEmailValidatedContactID, TestEmailNotValidatedContactID })
                {
                    ReportSectionController reportSectionController = new ReportSectionController(DatabaseTypeEnum.SqlServerTestDB);
                    Assert.IsNotNull(reportSectionController);
                    Assert.AreEqual(DatabaseTypeEnum.SqlServerTestDB, reportSectionController.DatabaseType);

                    ReportSection reportSectionFirst = new ReportSection();
                    using (CSSPDBContext db = new CSSPDBContext(DatabaseType))
                    {
                        ReportSectionService reportSectionService = new ReportSectionService(new Query(), db, ContactID);
                        reportSectionFirst = (from c in db.ReportSections select c).FirstOrDefault();
                    }

                    // ok with ReportSection info
                    IHttpActionResult jsonRet = reportSectionController.GetReportSectionWithID(reportSectionFirst.ReportSectionID);
                    Assert.IsNotNull(jsonRet);

                    OkNegotiatedContentResult <ReportSection> Ret = jsonRet as OkNegotiatedContentResult <ReportSection>;
                    ReportSection reportSectionRet = Ret.Content;
                    Assert.AreEqual(reportSectionFirst.ReportSectionID, reportSectionRet.ReportSectionID);

                    BadRequestErrorMessageResult badRequest = jsonRet as BadRequestErrorMessageResult;
                    Assert.IsNull(badRequest);

                    // Not Found
                    IHttpActionResult jsonRet2 = reportSectionController.GetReportSectionWithID(0);
                    Assert.IsNotNull(jsonRet2);

                    OkNegotiatedContentResult <ReportSection> reportSectionRet2 = jsonRet2 as OkNegotiatedContentResult <ReportSection>;
                    Assert.IsNull(reportSectionRet2);

                    NotFoundResult notFoundRequest = jsonRet2 as NotFoundResult;
                    Assert.IsNotNull(notFoundRequest);
                }
            }
        }
コード例 #20
0
        public IHttpActionResult Delete([FromBody] ReportSection reportSection, [FromUri] string lang = "en")
        {
            using (CSSPDBContext db = new CSSPDBContext(DatabaseType))
            {
                ReportSectionService reportSectionService = new ReportSectionService(new Query()
                {
                    Language = (lang == "fr" ? LanguageEnum.fr : LanguageEnum.en)
                }, db, ContactID);

                if (!reportSectionService.Delete(reportSection))
                {
                    return(BadRequest(String.Join("|||", reportSection.ValidationResults)));
                }
                else
                {
                    reportSection.ValidationResults = null;
                    return(Ok(reportSection));
                }
            }
        }
コード例 #21
0
        public static void DumpTablixes(AspNetCore.ReportingServices.ReportIntermediateFormat.Report report)
        {
            StreamWriter streamWriter = new StreamWriter(new FileStream("TablixDump.html", FileMode.Create));

            streamWriter.WriteLine("<html><body>");
            for (int i = 0; i < report.ReportSections.Count; i++)
            {
                ReportSection reportSection = report.ReportSections[i];
                for (int j = 0; j < reportSection.ReportItems.Count; j++)
                {
                    if (reportSection.ReportItems[j].ObjectType == ObjectType.Tablix)
                    {
                        SupportabilityRIFVisualizer.DumpTablix((AspNetCore.ReportingServices.ReportIntermediateFormat.Tablix)reportSection.ReportItems[j], streamWriter);
                    }
                }
            }
            streamWriter.WriteLine("</body></html>");
            streamWriter.Flush();
            streamWriter.Close();
        }
コード例 #22
0
        public void GetReportSectionList_Test()
        {
            foreach (CultureInfo culture in AllowableCulture)
            {
                ChangeCulture(culture);

                using (CSSPDBContext dbTestDB = new CSSPDBContext(DatabaseTypeEnum.SqlServerTestDB))
                {
                    ReportSectionService reportSectionService = new ReportSectionService(new Query()
                    {
                        Lang = culture.TwoLetterISOLanguageName
                    }, dbTestDB, ContactID);
                    ReportSection reportSection = (from c in dbTestDB.ReportSections select c).FirstOrDefault();
                    Assert.IsNotNull(reportSection);

                    List <ReportSection> reportSectionDirectQueryList = new List <ReportSection>();
                    reportSectionDirectQueryList = (from c in dbTestDB.ReportSections select c).Take(200).ToList();

                    foreach (string extra in new List <string>()
                    {
                        null, "A", "B", "C", "D", "E"
                    })
                    {
                        reportSectionService.Query.Extra = extra;

                        if (string.IsNullOrWhiteSpace(extra))
                        {
                            List <ReportSection> reportSectionList = new List <ReportSection>();
                            reportSectionList = reportSectionService.GetReportSectionList().ToList();
                            CheckReportSectionFields(reportSectionList);
                        }
                        else
                        {
                            //Assert.AreEqual(true, false);
                        }
                    }
                }
            }
        }
コード例 #23
0
        public ReportArea getReport(ReportSection section, string AreaName)
        {
            switch (section)
            {
            case ReportSection.External:
                foreach (ReportArea area in externals)
                {
                    if (area.name == AreaName)
                    {
                        return(area);
                    }
                }
                break;

            case ReportSection.Internal:
                foreach (ReportArea area in internals)
                {
                    if (area.name == AreaName)
                    {
                        return(area);
                    }
                }
                break;

            case ReportSection.General:
                foreach (ReportArea area in generals)
                {
                    if (area.name == AreaName)
                    {
                        return(area);
                    }
                }
                break;

            default:
                return(null);
            }
            return(null);
        }
コード例 #24
0
 private void BuildSection(ReportSection section)
 {
     DataRow[] childGroups = _marketGroups.Select("parentGroupID = " + section.Name);
     foreach (DataRow group in childGroups)
     {
         EveDataSet.invMarketGroupsRow marketGroup = (EveDataSet.invMarketGroupsRow)group;
         ReportSection childSection = new ReportSection(_columns.Length, marketGroup.marketGroupID.ToString(),
             marketGroup.marketGroupName, this);
         section.AddSection(childSection);
         BuildSection(childSection);
     }
 }
コード例 #25
0
        protected override void InitSections()
        {
            _sections = new ReportSections();

            UpdateStatus(0, 1, "Building Report Sections...", "", false);

            if (_byItemGroup)
            {
                // Note that an additonal root section 'Non-market items' may be added during
                // GetDataFromDatabase if it is required.
                List<int> itemIDs = Items.GetItemIDsWithTransactions(_financeAccessParams);
                List<int> tmpItemIDs = new List<int>();
                if (_tradedItemsOnly)
                {
                    List<int> tradedItemIDs = UserAccount.CurrentGroup.TradedItems.GetAllItemIDs();
                    foreach (int itemID in itemIDs)
                    {
                        if (tradedItemIDs.Contains(itemID)) { tmpItemIDs.Add(itemID); }
                    }
                    itemIDs = tmpItemIDs;
                }
                _marketGroups = MarketGroups.GetGroupsForItems(itemIDs);
                DataRow[] rootGroups = _marketGroups.Select("parentGroupID IS null");
                int counter = 0;
                ReportSection rootSection = new ReportSection(_columns.Length, "All Items", "All Items", this);
                _sections.Add(rootSection);
                foreach (DataRow group in rootGroups)
                {
                    counter++;
                    EveDataSet.invMarketGroupsRow marketGroup = (EveDataSet.invMarketGroupsRow)group;
                    ReportSection section = new ReportSection(_columns.Length, marketGroup.marketGroupID.ToString(),
                        marketGroup.marketGroupName, this);
                    rootSection.AddSection(section);
                    BuildSection(section);
                    UpdateStatus(counter, rootGroups.Length, "", section.Text, false);
                }
            }
            else
            {
                _sections.Add(new ReportSection(_columns.Length, "All Items", "All Items", this));
            }
            UpdateStatus(1, 1, "", "", false);
        }
コード例 #26
0
        protected override void InitSections()
        {
            _sections = new ReportSections();

            UpdateStatus(0, 1, "Building Report Sections...", "", false);

            if (_byItemGroup)
            {
                // Note that an additonal root section 'Non-market items' may be added during
                // GetDataFromDatabase if it is required.
                EveDataSet.invTypesDataTable items = Items.GetItemsThatAreAssets(_assetAccessParams);
                List<int> itemIDs = new List<int>();
                foreach (EveDataSet.invTypesRow item in items)
                {
                    itemIDs.Add(item.typeID);
                }
                _marketGroups = MarketGroups.GetGroupsForItems(itemIDs);
                DataRow[] rootGroups = _marketGroups.Select("parentGroupID IS null");
                int counter = 0;
                ReportSection rootSection = new ReportSection(_columns.Length, "All Items", "All Items", this);
                _sections.Add(rootSection);
                ReportSection nonMarket = new ReportSection(_columns.Length, "Non-Market Items", "Non-Market Items", this);
                rootSection.AddSection(nonMarket);
                foreach (DataRow group in rootGroups)
                {
                    counter++;
                    EveDataSet.invMarketGroupsRow marketGroup = (EveDataSet.invMarketGroupsRow)group;
                    ReportSection section = new ReportSection(_columns.Length, marketGroup.marketGroupID.ToString(),
                        marketGroup.marketGroupName, this);
                    rootSection.AddSection(section);
                    BuildSection(section);
                    UpdateStatus(counter, rootGroups.Length, "", section.Text, false);
                }
            }
            else
            {
                _sections.Add(new ReportSection(_columns.Length, "All Items", "All Items", this));
            }
            UpdateStatus(1, 1, "", "", false);
        }
コード例 #27
0
        private Report CreateReport(string fileName)
        {
            string ext = Path.GetExtension(fileName);

            ext = ext.ToLower();

            var r = new Report();

            r.Title = "Oxyplot example report";

            var main = new ReportSection();

            r.AddHeader(1, "Example report from OxyPlot");

            // r.AddHeader(2, "Content");
            // r.AddTableOfContents(main);
            r.Add(main);

            main.AddHeader(2, "Introduction");
            main.AddParagraph("The content in this file was generated by OxyPlot.");
            main.AddParagraph("See http://oxyplot.codeplex.com for more information.");

            var dir  = Path.GetDirectoryName(fileName);
            var name = Path.GetFileNameWithoutExtension(fileName);

            string fileNameWithoutExtension = Path.Combine(dir, name);

            main.AddHeader(2, "Plot");
            main.AddParagraph("This plot was rendered to a file and included in the report as a plot.");
            main.AddPlot(this.Model, "Plot", 800, 500);

            main.AddHeader(2, "Drawing");
            main.AddParagraph("Not yet implemented.");

            /*            switch (ext)
             *          {
             *              case ".html":
             *                  {
             *                      main.AddHeader(2, "Plot (svg)");
             *                      main.AddParagraph("This plot was rendered to a .svg file and included in the report.");
             *                      main.AddPlot(Model, "SVG plot", 800, 500);
             *
             *                      //main.AddHeader(2, "Drawing (vector)");
             *                      //main.AddParagraph("This plot was rendered to SVG and included in the report as a drawing.");
             *                      //var svg = Model.ToSvg(800, 500);
             *                      //main.AddDrawing(svg, "SVG plot as a drawing.");
             *                      break;
             *                  }
             *              case ".pdf":
             *              case ".tex":
             *                  {
             *                      main.AddHeader(2, "Plot (vector)");
             *                      main.AddParagraph("This plot was rendered to a .pdf file and included in the report.");
             *                      main.AddPlot(Model, "PDF plot", 800, 500);
             *                      //var pdfPlotFileName = fileNameWithoutExtension + "_plot.pdf";
             *                      //PdfExporter.Export(Model, pdfPlotFileName, 800, 500);
             *                      //main.AddParagraph("This plot was rendered to PDF and embedded in the report.");
             *                      //main.AddImage(pdfPlotFileName, "PDF plot");
             *                      break;
             *                  }
             *              case ".docx":
             *                  {
             *                      main.AddHeader(2, "Plot");
             *                      main.AddParagraph("This plot was rendered to a .png file and included in the report.");
             *                      main.AddPlot(Model, "Plot", 800, 500);
             *                  }
             *                  break;
             *          }*/
            main.AddHeader(2, "Image");
            main.AddParagraph("The plot is rendered to a .png file and included in the report as an image. Zoom in to see the difference.");

            string pngPlotFileName = fileNameWithoutExtension + "_Plot2.png";

            PngExporter.Export(this.Model, pngPlotFileName, 800, 500, OxyColors.Automatic);
            main.AddImage(pngPlotFileName, "Plot as image");

            main.AddHeader(2, "Data");
            int i = 1;

            foreach (OxyPlot.Series.DataPointSeries s in this.Model.Series)
            {
                main.AddHeader(3, "Data series " + (i++));
                var pt = main.AddPropertyTable("Properties of the " + s.GetType().Name, new[] { s });
                pt.Fields[0].Width = 50;
                pt.Fields[1].Width = 100;

                var fields = new List <ItemsTableField>
                {
                    new ItemsTableField("X", "X")
                    {
                        Width = 60, StringFormat = "0.00"
                    },
                    new ItemsTableField("Y", "Y")
                    {
                        Width = 60, StringFormat = "0.00"
                    }
                };
                main.Add(new ItemsTable {
                    Caption = "Data", Fields = fields, Items = s.Points
                });
            }

            // main.AddHeader(3, "Equations");
            // main.AddEquation(@"E = m \cdot c^2");
            // main.AddEquation(@"\oint \vec{B} \cdot d\vec{S} = 0");
            return(r);
        }
コード例 #28
0
 public INCCTestDataStyle(System.Type column, short prelines, ReportSection sec = ReportSection.Standard)
     : base(column, prelines, sec)
 {
 }
コード例 #29
0
        protected override void InitSections()
        {
            _sections = new ReportSections();
            ReportSection root = new ReportSection(_columns.Length, "NAV", "NAV", this);
            _sections.Add(root);
            ReportSection walletSection = new ReportSection(_columns.Length, "W", "Wallet Balance", this);
            ReportSection escrowSection = new ReportSection(_columns.Length, "E", "Cash in Escrow", this);
            ReportSection assetsSection = new ReportSection(_columns.Length, "A", "Assets", this);
            ReportSection sellOrdersSection = new ReportSection(_columns.Length, "S", "Sell Orders", this);

            root.AddSection(walletSection);
            root.AddSection(escrowSection);
            root.AddSection(assetsSection);
            root.AddSection(sellOrdersSection);

            foreach (FinanceAccessParams accessParams in _financeAccessParams)
            {
                long ownerID = accessParams.OwnerID;
                bool corp = false;

                APICharacter character = UserAccount.CurrentGroup.GetCharacter(ownerID, ref corp);
                //ReportSection ownerAssets = null;

                if (corp)
                {
                    walletSection.AddSection(new ReportSection(_columns.Length, "W" + ownerID.ToString(),
                        character.CorpName, this));
                    escrowSection.AddSection(new ReportSection(_columns.Length, "E" + ownerID.ToString(),
                        character.CorpName, this));
                    //ownerAssets = new ReportSection(_columns.Length, "A" + ownerID.ToString(),
                    //    character.CorpName, this);
                }
                else
                {
                    //ownerAssets = new ReportSection(_columns.Length, "A" + ownerID.ToString(),
                    //    character.CharName, this);
                }
                //assetsSection.AddSection(ownerAssets);
            }
        }
コード例 #30
0
 internal abstract void UpdatePageSections(ReportSection section);
コード例 #31
0
        public IPersistable CreateRIFObject(ObjectType objectType, ref IntermediateFormatReader context)
        {
            IPersistable persistable = null;

            if (objectType == ObjectType.Null)
            {
                return(null);
            }
            IDOwner    parentIDOwner    = this.m_parentIDOwner;
            ReportItem parentReportItem = this.m_parentReportItem;

            switch (objectType)
            {
            case ObjectType.PageSection:
                persistable             = new PageSection(this.m_parentReportItem);
                this.m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.Line:
                persistable             = new Line(this.m_parentReportItem);
                this.m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.Rectangle:
                persistable             = new Rectangle(this.m_parentReportItem);
                this.m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.Image:
                persistable             = new Image(this.m_parentReportItem);
                this.m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.TextBox:
                persistable             = new TextBox(this.m_parentReportItem);
                this.m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.SubReport:
                persistable             = new SubReport(this.m_parentReportItem);
                this.m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.Grouping:
                persistable = new Grouping(ConstructionPhase.Deserializing);
                break;

            case ObjectType.Sorting:
                persistable = new Sorting(ConstructionPhase.Deserializing);
                break;

            case ObjectType.ReportItemCollection:
                persistable = new ReportItemCollection();
                break;

            case ObjectType.ReportItemIndexer:
                persistable = (IPersistable)(object)default(ReportItemIndexer);
                break;

            case ObjectType.Style:
                persistable = new Style(ConstructionPhase.Deserializing);
                break;

            case ObjectType.AttributeInfo:
                persistable = new AttributeInfo();
                break;

            case ObjectType.Visibility:
                persistable = new Visibility();
                break;

            case ObjectType.ExpressionInfo:
                persistable = new ExpressionInfo();
                break;

            case ObjectType.ExpressionInfoTypeValuePair:
                persistable = new ExpressionInfoTypeValuePair();
                break;

            case ObjectType.DataAggregateInfo:
                persistable = new DataAggregateInfo();
                break;

            case ObjectType.RunningValueInfo:
                persistable = new RunningValueInfo();
                break;

            case ObjectType.Filter:
                persistable = new Filter();
                break;

            case ObjectType.DataSource:
                persistable = new DataSource();
                break;

            case ObjectType.DataSet:
                persistable = new DataSet();
                break;

            case ObjectType.ReportQuery:
                persistable = new ReportQuery();
                break;

            case ObjectType.Field:
                persistable = new Field();
                break;

            case ObjectType.ParameterValue:
                persistable = new ParameterValue();
                break;

            case ObjectType.ReportSnapshot:
                persistable = new ReportSnapshot();
                break;

            case ObjectType.DocumentMapNode:
                persistable = new DocumentMapNode();
                break;

            case ObjectType.DocumentMapBeginContainer:
                persistable = DocumentMapBeginContainer.Instance;
                break;

            case ObjectType.DocumentMapEndContainer:
                persistable = DocumentMapEndContainer.Instance;
                break;

            case ObjectType.ReportInstance:
                persistable = new ReportInstance();
                break;

            case ObjectType.ParameterInfo:
                persistable = new ParameterInfo();
                break;

            case ObjectType.ValidValue:
                persistable = new ValidValue();
                break;

            case ObjectType.ParameterDataSource:
                persistable = new ParameterDataSource();
                break;

            case ObjectType.ParameterDef:
                persistable = new ParameterDef();
                break;

            case ObjectType.ProcessingMessage:
                persistable = new ProcessingMessage();
                break;

            case ObjectType.CodeClass:
                persistable = (IPersistable)(object)default(CodeClass);
                break;

            case ObjectType.Action:
                persistable = new Action();
                break;

            case ObjectType.RenderingPagesRanges:
                persistable = (IPersistable)(object)default(RenderingPagesRanges);
                break;

            case ObjectType.IntermediateFormatVersion:
                persistable = new IntermediateFormatVersion();
                break;

            case ObjectType.ImageInfo:
                persistable = new ImageInfo();
                break;

            case ObjectType.ActionItem:
                persistable = new ActionItem();
                break;

            case ObjectType.DataValue:
                persistable = new DataValue();
                break;

            case ObjectType.CustomReportItem:
                persistable             = new CustomReportItem(this.m_parentReportItem);
                this.m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.SortFilterEventInfoMap:
                persistable = new SortFilterEventInfoMap();
                break;

            case ObjectType.SortFilterEventInfo:
                persistable = new SortFilterEventInfo();
                break;

            case ObjectType.EndUserSort:
                persistable = new EndUserSort();
                break;

            case ObjectType.ScopeLookupTable:
                persistable = new ScopeLookupTable();
                break;

            case ObjectType.Tablix:
                persistable             = new Tablix(this.m_parentReportItem);
                this.m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.TablixHeader:
                persistable = new TablixHeader();
                break;

            case ObjectType.TablixMember:
                persistable = new TablixMember();
                break;

            case ObjectType.TablixColumn:
                persistable = new TablixColumn();
                break;

            case ObjectType.TablixRow:
                persistable = new TablixRow();
                break;

            case ObjectType.TablixCornerCell:
                persistable = new TablixCornerCell();
                break;

            case ObjectType.TablixCell:
                persistable = new TablixCell();
                break;

            case ObjectType.Chart:
                persistable             = new Chart(this.m_parentReportItem);
                this.m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.ChartMember:
                persistable = new ChartMember();
                break;

            case ObjectType.ChartSeries:
                persistable = new ChartSeries();
                break;

            case ObjectType.ChartDataPoint:
                persistable = new ChartDataPoint();
                break;

            case ObjectType.ChartDataPointValues:
                persistable = new ChartDataPointValues();
                break;

            case ObjectType.ChartArea:
                persistable = new ChartArea();
                break;

            case ObjectType.ChartLegend:
                persistable = new ChartLegend();
                break;

            case ObjectType.ChartLegendTitle:
                persistable = new ChartLegendTitle();
                break;

            case ObjectType.ChartAxis:
                persistable = new ChartAxis();
                break;

            case ObjectType.ThreeDProperties:
                persistable = new ChartThreeDProperties();
                break;

            case ObjectType.ChartDataLabel:
                persistable = new ChartDataLabel();
                break;

            case ObjectType.ChartMarker:
                persistable = new ChartMarker();
                break;

            case ObjectType.ChartTitle:
                persistable = new ChartTitle();
                break;

            case ObjectType.ChartAxisScaleBreak:
                persistable = new ChartAxisScaleBreak();
                break;

            case ObjectType.ChartDerivedSeries:
                persistable = new ChartDerivedSeries();
                break;

            case ObjectType.ChartBorderSkin:
                persistable = new ChartBorderSkin();
                break;

            case ObjectType.ChartNoDataMessage:
                persistable = new ChartNoDataMessage();
                break;

            case ObjectType.ChartItemInLegend:
                persistable = new ChartItemInLegend();
                break;

            case ObjectType.ChartEmptyPoints:
                persistable = new ChartEmptyPoints();
                break;

            case ObjectType.ChartNoMoveDirections:
                persistable = new ChartNoMoveDirections();
                break;

            case ObjectType.ChartFormulaParameter:
                persistable = new ChartFormulaParameter();
                break;

            case ObjectType.ChartLegendColumn:
                persistable = new ChartLegendColumn();
                break;

            case ObjectType.ChartLegendColumnHeader:
                persistable = new ChartLegendColumnHeader();
                break;

            case ObjectType.ChartLegendCustomItem:
                persistable = new ChartLegendCustomItem();
                break;

            case ObjectType.ChartLegendCustomItemCell:
                persistable = new ChartLegendCustomItemCell();
                break;

            case ObjectType.ChartAlignType:
                persistable = new ChartAlignType();
                break;

            case ObjectType.ChartElementPosition:
                persistable = new ChartElementPosition();
                break;

            case ObjectType.ChartSmartLabel:
                persistable = new ChartSmartLabel();
                break;

            case ObjectType.ChartStripLine:
                persistable = new ChartStripLine();
                break;

            case ObjectType.ChartAxisTitle:
                persistable = new ChartAxisTitle();
                break;

            case ObjectType.ChartCustomPaletteColor:
                persistable = new ChartCustomPaletteColor();
                break;

            case ObjectType.GridLines:
                persistable = new ChartGridLines();
                break;

            case ObjectType.ChartTickMarks:
                persistable = new ChartTickMarks();
                break;

            case ObjectType.DataMember:
                persistable = new DataMember();
                break;

            case ObjectType.CustomDataRow:
                persistable = new CustomDataRow();
                break;

            case ObjectType.DataCell:
                persistable = new DataCell();
                break;

            case ObjectType.Variable:
                persistable = new Variable();
                break;

            case ObjectType.Page:
                persistable = new Page();
                break;

            case ObjectType.Paragraph:
                persistable = new Paragraph();
                break;

            case ObjectType.TextRun:
                persistable = new TextRun();
                break;

            case ObjectType.Report:
                persistable             = new Report(this.m_parentReportItem);
                this.m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.GaugePanel:
                persistable             = new GaugePanel(this.m_parentReportItem);
                this.m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.GaugeMember:
                persistable = new GaugeMember();
                break;

            case ObjectType.GaugeRow:
                persistable = new GaugeRow();
                break;

            case ObjectType.GaugeCell:
                persistable = new GaugeCell();
                break;

            case ObjectType.BackFrame:
                persistable = new BackFrame();
                break;

            case ObjectType.CapImage:
                persistable = new CapImage();
                break;

            case ObjectType.FrameBackground:
                persistable = new FrameBackground();
                break;

            case ObjectType.FrameImage:
                persistable = new FrameImage();
                break;

            case ObjectType.CustomLabel:
                persistable = new CustomLabel();
                break;

            case ObjectType.GaugeImage:
                persistable = new GaugeImage();
                break;

            case ObjectType.GaugeInputValue:
                persistable = new GaugeInputValue();
                break;

            case ObjectType.GaugeLabel:
                persistable = new GaugeLabel();
                break;

            case ObjectType.GaugePanelItem:
                persistable = new GaugePanelItem();
                break;

            case ObjectType.GaugeTickMarks:
                persistable = new GaugeTickMarks();
                break;

            case ObjectType.LinearGauge:
                persistable = new LinearGauge();
                break;

            case ObjectType.LinearPointer:
                persistable = new LinearPointer();
                break;

            case ObjectType.LinearScale:
                persistable = new LinearScale();
                break;

            case ObjectType.NumericIndicator:
                persistable = new NumericIndicator();
                break;

            case ObjectType.PinLabel:
                persistable = new PinLabel();
                break;

            case ObjectType.PointerCap:
                persistable = new PointerCap();
                break;

            case ObjectType.PointerImage:
                persistable = new PointerImage();
                break;

            case ObjectType.RadialGauge:
                persistable = new RadialGauge();
                break;

            case ObjectType.RadialPointer:
                persistable = new RadialPointer();
                break;

            case ObjectType.RadialScale:
                persistable = new RadialScale();
                break;

            case ObjectType.ScaleLabels:
                persistable = new ScaleLabels();
                break;

            case ObjectType.ScalePin:
                persistable = new ScalePin();
                break;

            case ObjectType.ScaleRange:
                persistable = new ScaleRange();
                break;

            case ObjectType.IndicatorImage:
                persistable = new IndicatorImage();
                break;

            case ObjectType.StateIndicator:
                persistable = new StateIndicator();
                break;

            case ObjectType.Thermometer:
                persistable = new Thermometer();
                break;

            case ObjectType.TickMarkStyle:
                persistable = new TickMarkStyle();
                break;

            case ObjectType.TopImage:
                persistable = new TopImage();
                break;

            case ObjectType.LookupInfo:
                persistable = new LookupInfo();
                break;

            case ObjectType.LookupDestinationInfo:
                persistable = new LookupDestinationInfo();
                break;

            case ObjectType.ReportSection:
                persistable = new ReportSection();
                break;

            case ObjectType.MapFieldDefinition:
                persistable = new MapFieldDefinition();
                break;

            case ObjectType.MapFieldName:
                persistable = new MapFieldName();
                break;

            case ObjectType.MapLineLayer:
                persistable = new MapLineLayer();
                break;

            case ObjectType.MapShapefile:
                persistable = new MapShapefile();
                break;

            case ObjectType.MapPolygonLayer:
                persistable = new MapPolygonLayer();
                break;

            case ObjectType.MapSpatialDataRegion:
                persistable = new MapSpatialDataRegion();
                break;

            case ObjectType.MapSpatialDataSet:
                persistable = new MapSpatialDataSet();
                break;

            case ObjectType.MapPointLayer:
                persistable = new MapPointLayer();
                break;

            case ObjectType.MapTile:
                persistable = new MapTile();
                break;

            case ObjectType.MapTileLayer:
                persistable = new MapTileLayer();
                break;

            case ObjectType.MapField:
                persistable = new MapField();
                break;

            case ObjectType.MapLine:
                persistable = new MapLine();
                break;

            case ObjectType.MapPolygon:
                persistable = new MapPolygon();
                break;

            case ObjectType.MapPoint:
                persistable = new MapPoint();
                break;

            case ObjectType.MapLineTemplate:
                persistable = new MapLineTemplate();
                break;

            case ObjectType.MapPolygonTemplate:
                persistable = new MapPolygonTemplate();
                break;

            case ObjectType.MapMarkerTemplate:
                persistable = new MapMarkerTemplate();
                break;

            case ObjectType.Map:
                persistable             = new Map(this.m_parentReportItem);
                this.m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.MapBorderSkin:
                persistable = new MapBorderSkin();
                break;

            case ObjectType.MapDataRegion:
                persistable = new MapDataRegion(this.m_parentReportItem);
                break;

            case ObjectType.MapMember:
                persistable = new MapMember();
                break;

            case ObjectType.MapRow:
                persistable = new MapRow();
                break;

            case ObjectType.MapCell:
                persistable = new MapCell();
                break;

            case ObjectType.MapLocation:
                persistable = new MapLocation();
                break;

            case ObjectType.MapSize:
                persistable = new MapSize();
                break;

            case ObjectType.MapGridLines:
                persistable = new MapGridLines();
                break;

            case ObjectType.MapBindingFieldPair:
                persistable = new MapBindingFieldPair();
                break;

            case ObjectType.MapCustomView:
                persistable = new MapCustomView();
                break;

            case ObjectType.MapDataBoundView:
                persistable = new MapDataBoundView();
                break;

            case ObjectType.MapElementView:
                persistable = new MapElementView();
                break;

            case ObjectType.MapViewport:
                persistable = new MapViewport();
                break;

            case ObjectType.MapLimits:
                persistable = new MapLimits();
                break;

            case ObjectType.MapColorScale:
                persistable = new MapColorScale();
                break;

            case ObjectType.MapColorScaleTitle:
                persistable = new MapColorScaleTitle();
                break;

            case ObjectType.MapDistanceScale:
                persistable = new MapDistanceScale();
                break;

            case ObjectType.MapTitle:
                persistable = new MapTitle();
                break;

            case ObjectType.MapLegend:
                persistable = new MapLegend();
                break;

            case ObjectType.MapLegendTitle:
                persistable = new MapLegendTitle();
                break;

            case ObjectType.MapBucket:
                persistable = new MapBucket();
                break;

            case ObjectType.MapColorPaletteRule:
                persistable = new MapColorPaletteRule();
                break;

            case ObjectType.MapColorRangeRule:
                persistable = new MapColorRangeRule();
                break;

            case ObjectType.MapCustomColorRule:
                persistable = new MapCustomColorRule();
                break;

            case ObjectType.MapCustomColor:
                persistable = new MapCustomColor();
                break;

            case ObjectType.MapLineRules:
                persistable = new MapLineRules();
                break;

            case ObjectType.MapPolygonRules:
                persistable = new MapPolygonRules();
                break;

            case ObjectType.MapSizeRule:
                persistable = new MapSizeRule();
                break;

            case ObjectType.MapMarkerImage:
                persistable = new MapMarkerImage();
                break;

            case ObjectType.MapMarker:
                persistable = new MapMarker();
                break;

            case ObjectType.MapMarkerRule:
                persistable = new MapMarkerRule();
                break;

            case ObjectType.MapPointRules:
                persistable = new MapPointRules();
                break;

            case ObjectType.PageBreak:
                persistable = new PageBreak();
                break;

            case ObjectType.DataScopeInfo:
                persistable = new DataScopeInfo();
                break;

            case ObjectType.LinearJoinInfo:
                persistable = new LinearJoinInfo();
                break;

            case ObjectType.IntersectJoinInfo:
                persistable = new IntersectJoinInfo();
                break;

            case ObjectType.BucketedDataAggregateInfos:
                persistable = new BucketedDataAggregateInfos();
                break;

            case ObjectType.DataAggregateInfoBucket:
                persistable = new DataAggregateInfoBucket();
                break;

            case ObjectType.NumericIndicatorRange:
                persistable = new NumericIndicatorRange();
                break;

            case ObjectType.IndicatorState:
                persistable = new IndicatorState();
                break;

            case ObjectType.SharedDataSetQuery:
                persistable = new SharedDataSetQuery();
                break;

            case ObjectType.DataSetCore:
                persistable = new DataSetCore();
                break;

            case ObjectType.DataSetParameterValue:
                persistable = new DataSetParameterValue();
                break;

            case ObjectType.RIFVariantContainer:
                persistable = new RIFVariantContainer();
                break;

            case ObjectType.IdcRelationship:
                persistable = new IdcRelationship();
                break;

            case ObjectType.DefaultRelationship:
                persistable = new DefaultRelationship();
                break;

            case ObjectType.JoinCondition:
                persistable = new Relationship.JoinCondition();
                break;

            case ObjectType.BandLayoutOptions:
                persistable = new BandLayoutOptions();
                break;

            case ObjectType.LabelData:
                persistable = new LabelData();
                break;

            case ObjectType.Slider:
                persistable = new Slider();
                break;

            case ObjectType.Coverflow:
                persistable = new Coverflow();
                break;

            case ObjectType.PlayAxis:
                persistable = new PlayAxis();
                break;

            case ObjectType.BandNavigationCell:
                persistable = new BandNavigationCell();
                break;

            case ObjectType.Tabstrip:
                persistable = new Tabstrip();
                break;

            case ObjectType.NavigationItem:
                persistable = new NavigationItem();
                break;

            case ObjectType.ScopedFieldInfo:
                persistable = new ScopedFieldInfo();
                break;

            default:
                Global.Tracer.Assert(false, "Unsupported object type: " + objectType.ToString());
                break;
            }
            IDOwner iDOwner = persistable as IDOwner;

            if (iDOwner != null)
            {
                iDOwner.ParentInstancePath = this.m_parentIDOwner;
                this.m_parentIDOwner       = iDOwner;
            }
            persistable.Deserialize(context);
            this.m_parentIDOwner    = parentIDOwner;
            this.m_parentReportItem = parentReportItem;
            return(persistable);
        }
コード例 #32
0
        private static List <ReportSection> PrepareInspectionForScoring(Inspection inspection)
        {
            List <ReportSection> reportSections = new List <ReportSection>();
            double sumTotalAvailablePoints      = 0;
            double sumTotalEarnedPoints         = 0;
            bool   anyUnacceptables             = false;

            foreach (SectionModel section in inspection.Checklist.Sections)
            {
                //We can have a commendable section even with unacceptable parts.
                //bool anyUnacceptableParts = false;
                if (section.SectionParts.Any())
                {
                    double sumSectionAvailablePoints = 0;
                    double sumSectionEarnedPoints    = 0;
                    foreach (SectionPart part in section.SectionParts)
                    {
                        Tuple <double, double, double> partScores = ScoringHelper.ScorePart(part, inspection);
                        part.availablePoints = partScores.Item1;
                        part.earnedPoints    = partScores.Item2;
                        part.percentage      = partScores.Item3;
                        if (part.availablePoints > 0)
                        {
                            double percentScore = part.percentage * 100;
                            if (percentScore < inspection.Checklist.ScoreThresholdSatisfactory)
                            {
                                part.rating = Rating.Unacceptable;
                                //anyUnacceptableParts = true;
                            }
                            else if (percentScore < inspection.Checklist.ScoreThresholdCommendable)
                            {
                                part.rating = Rating.Satisfactory;
                            }
                            else
                            {
                                part.rating = Rating.Commendable;
                            }
                        }
                        sumSectionAvailablePoints += partScores.Item1;
                        sumSectionEarnedPoints    += partScores.Item2;
                    }
                    section.availablePoints = sumSectionAvailablePoints;
                    section.earnedPoints    = sumSectionEarnedPoints;
                    if (sumSectionAvailablePoints > 0)
                    {
                        section.percentage = sumSectionEarnedPoints / sumSectionAvailablePoints;
                    }
                    else
                    {
                        section.percentage = 0;
                    }
                }
                else
                {
                    Tuple <double, double, double> sectionScores = ScoringHelper.ScoreSection(section, inspection);
                    section.availablePoints = sectionScores.Item1;
                    section.earnedPoints    = sectionScores.Item2;
                    section.percentage      = sectionScores.Item3;
                }

                if (section.availablePoints > 0)
                {
                    double percentScore = section.percentage * 100;
                    if (percentScore < inspection.Checklist.ScoreThresholdSatisfactory)
                    {
                        anyUnacceptables = true;
                        section.rating   = Rating.Unacceptable;
                    }
                    else if (percentScore < inspection.Checklist.ScoreThresholdCommendable /*|| anyUnacceptableParts*/)
                    {
                        section.rating = Rating.Satisfactory;
                    }
                    else
                    {
                        section.rating = Rating.Commendable;
                    }
                }
                else
                {
                    section.rating = Rating.None;
                }

                sumTotalAvailablePoints += section.availablePoints;
                sumTotalEarnedPoints    += section.earnedPoints;
                if (true)                       //if we're supposed to render this section
                {
                    ReportSection reportSection = new ReportSection(section);
                    reportSection.PartsToRender = section.SectionParts;
                    reportSections.Add(reportSection);
                }
            }
            inspection.availablePoints = sumTotalAvailablePoints;
            inspection.earnedPoints    = sumTotalEarnedPoints;
            if (sumTotalAvailablePoints > 0)
            {
                inspection.percentage = sumTotalEarnedPoints / sumTotalAvailablePoints;
                double percentScore = inspection.percentage * 100;
                if (percentScore < inspection.Checklist.ScoreThresholdSatisfactory)
                {
                    inspection.rating = Rating.Unacceptable;
                }
                else if (percentScore < inspection.Checklist.ScoreThresholdCommendable || anyUnacceptables)
                {
                    inspection.rating = Rating.Satisfactory;
                }
                else
                {
                    inspection.rating = Rating.Commendable;
                }
            }
            else
            {
                inspection.percentage = 0;
                inspection.rating     = Rating.None;
            }
            return(reportSections);
        }
コード例 #33
0
ファイル: SectionTemplate.cs プロジェクト: jangocheng/library
 public SectionTemplate(ReportSection model)
 {
     Model = model;
 }
コード例 #34
0
 public ReportSection SaveSection(ReportSection section)
 {
     return _baseRepository.SaveOrUpdate(section);
 }
コード例 #35
0
        private Report CreateReport(string fileName)
        {
            string ext = Path.GetExtension(fileName);
            ext = ext.ToLower();

            var r = new Report();
            r.Title = "Oxyplot example report";

            var main = new ReportSection();

            r.AddHeader(1, "Example report from OxyPlot");

            // r.AddHeader(2, "Content");
            // r.AddTableOfContents(main);
            r.Add(main);

            main.AddHeader(2, "Introduction");
            main.AddParagraph("The content in this file was generated by OxyPlot.");
            main.AddParagraph("See http://oxyplot.codeplex.com for more information.");

            var dir = Path.GetDirectoryName(fileName);
            var name = Path.GetFileNameWithoutExtension(fileName);

            string fileNameWithoutExtension = Path.Combine(dir, name);

            main.AddHeader(2, "Plot");
            main.AddParagraph("This plot was rendered to a file and included in the report as a plot.");
            main.AddPlot(this.Model, "Plot", 800, 500);

            main.AddHeader(2, "Drawing");
            main.AddParagraph("Not yet implemented.");

            /*            switch (ext)
                        {
                            case ".html":
                                {
                                    main.AddHeader(2, "Plot (svg)");
                                    main.AddParagraph("This plot was rendered to a .svg file and included in the report.");
                                    main.AddPlot(Model, "SVG plot", 800, 500);

                                    //main.AddHeader(2, "Drawing (vector)");
                                    //main.AddParagraph("This plot was rendered to SVG and included in the report as a drawing.");
                                    //var svg = Model.ToSvg(800, 500);
                                    //main.AddDrawing(svg, "SVG plot as a drawing.");
                                    break;
                                }
                            case ".pdf":
                            case ".tex":
                                {
                                    main.AddHeader(2, "Plot (vector)");
                                    main.AddParagraph("This plot was rendered to a .pdf file and included in the report.");
                                    main.AddPlot(Model, "PDF plot", 800, 500);
                                    //var pdfPlotFileName = fileNameWithoutExtension + "_plot.pdf";
                                    //PdfExporter.Export(Model, pdfPlotFileName, 800, 500);
                                    //main.AddParagraph("This plot was rendered to PDF and embedded in the report.");
                                    //main.AddImage(pdfPlotFileName, "PDF plot");
                                    break;
                                }
                            case ".docx":
                                {
                                    main.AddHeader(2, "Plot");
                                    main.AddParagraph("This plot was rendered to a .png file and included in the report.");
                                    main.AddPlot(Model, "Plot", 800, 500);
                                }
                                break;
                        }*/
            main.AddHeader(2, "Image");
            main.AddParagraph("The plot is rendered to a .png file and included in the report as an image. Zoom in to see the difference.");

            string pngPlotFileName = fileNameWithoutExtension + "_Plot2.png";
            PngExporter.Export(this.Model, pngPlotFileName, 800, 500, OxyColors.Automatic);
            main.AddImage(pngPlotFileName, "Plot as image");

            main.AddHeader(2, "Data");
            int i = 1;
            foreach (OxyPlot.Series.DataPointSeries s in this.Model.Series)
            {
                main.AddHeader(3, "Data series " + (i++));
                var pt = main.AddPropertyTable("Properties of the " + s.GetType().Name, new[] { s });
                pt.Fields[0].Width = 50;
                pt.Fields[1].Width = 100;

                var fields = new List<ItemsTableField>
                    {
                        new ItemsTableField("X", "X") { Width = 60, StringFormat = "0.00" },
                        new ItemsTableField("Y", "Y") { Width = 60, StringFormat = "0.00" }
                    };
                main.Add(new ItemsTable { Caption = "Data", Fields = fields, Items = s.Points });
            }

            // main.AddHeader(3, "Equations");
            // main.AddEquation(@"E = m \cdot c^2");
            // main.AddEquation(@"\oint \vec{B} \cdot d\vec{S} = 0");
            return r;
        }
コード例 #36
0
 public abstract void UpdatePageSections(ReportSection section);
コード例 #37
0
        private IEnumerable <ValidationResult> Validate(ValidationContext validationContext, ActionDBTypeEnum actionDBType)
        {
            string retStr = "";
            Enums  enums  = new Enums(LanguageRequest);
            ReportSectionLanguage reportSectionLanguage = validationContext.ObjectInstance as ReportSectionLanguage;

            reportSectionLanguage.HasErrors = false;

            if (actionDBType == ActionDBTypeEnum.Update || actionDBType == ActionDBTypeEnum.Delete)
            {
                if (reportSectionLanguage.ReportSectionLanguageID == 0)
                {
                    reportSectionLanguage.HasErrors = true;
                    yield return(new ValidationResult(string.Format(CSSPServicesRes._IsRequired, "ReportSectionLanguageID"), new[] { "ReportSectionLanguageID" }));
                }

                if (!(from c in db.ReportSectionLanguages select c).Where(c => c.ReportSectionLanguageID == reportSectionLanguage.ReportSectionLanguageID).Any())
                {
                    reportSectionLanguage.HasErrors = true;
                    yield return(new ValidationResult(string.Format(CSSPServicesRes.CouldNotFind_With_Equal_, "ReportSectionLanguage", "ReportSectionLanguageID", reportSectionLanguage.ReportSectionLanguageID.ToString()), new[] { "ReportSectionLanguageID" }));
                }
            }

            ReportSection ReportSectionReportSectionID = (from c in db.ReportSections where c.ReportSectionID == reportSectionLanguage.ReportSectionID select c).FirstOrDefault();

            if (ReportSectionReportSectionID == null)
            {
                reportSectionLanguage.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes.CouldNotFind_With_Equal_, "ReportSection", "ReportSectionID", reportSectionLanguage.ReportSectionID.ToString()), new[] { "ReportSectionID" }));
            }

            retStr = enums.EnumTypeOK(typeof(LanguageEnum), (int?)reportSectionLanguage.Language);
            if (!string.IsNullOrWhiteSpace(retStr))
            {
                reportSectionLanguage.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes._IsRequired, "Language"), new[] { "Language" }));
            }

            if (string.IsNullOrWhiteSpace(reportSectionLanguage.ReportSectionName))
            {
                reportSectionLanguage.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes._IsRequired, "ReportSectionName"), new[] { "ReportSectionName" }));
            }

            if (!string.IsNullOrWhiteSpace(reportSectionLanguage.ReportSectionName) && reportSectionLanguage.ReportSectionName.Length > 100)
            {
                reportSectionLanguage.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes._MaxLengthIs_, "ReportSectionName", "100"), new[] { "ReportSectionName" }));
            }

            retStr = enums.EnumTypeOK(typeof(TranslationStatusEnum), (int?)reportSectionLanguage.TranslationStatusReportSectionName);
            if (!string.IsNullOrWhiteSpace(retStr))
            {
                reportSectionLanguage.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes._IsRequired, "TranslationStatusReportSectionName"), new[] { "TranslationStatusReportSectionName" }));
            }

            if (string.IsNullOrWhiteSpace(reportSectionLanguage.ReportSectionText))
            {
                reportSectionLanguage.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes._IsRequired, "ReportSectionText"), new[] { "ReportSectionText" }));
            }

            if (!string.IsNullOrWhiteSpace(reportSectionLanguage.ReportSectionText) && reportSectionLanguage.ReportSectionText.Length > 10000)
            {
                reportSectionLanguage.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes._MaxLengthIs_, "ReportSectionText", "10000"), new[] { "ReportSectionText" }));
            }

            retStr = enums.EnumTypeOK(typeof(TranslationStatusEnum), (int?)reportSectionLanguage.TranslationStatusReportSectionText);
            if (!string.IsNullOrWhiteSpace(retStr))
            {
                reportSectionLanguage.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes._IsRequired, "TranslationStatusReportSectionText"), new[] { "TranslationStatusReportSectionText" }));
            }

            if (reportSectionLanguage.LastUpdateDate_UTC.Year == 1)
            {
                reportSectionLanguage.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes._IsRequired, "LastUpdateDate_UTC"), new[] { "LastUpdateDate_UTC" }));
            }
            else
            {
                if (reportSectionLanguage.LastUpdateDate_UTC.Year < 1980)
                {
                    reportSectionLanguage.HasErrors = true;
                    yield return(new ValidationResult(string.Format(CSSPServicesRes._YearShouldBeBiggerThan_, "LastUpdateDate_UTC", "1980"), new[] { "LastUpdateDate_UTC" }));
                }
            }

            TVItem TVItemLastUpdateContactTVItemID = (from c in db.TVItems where c.TVItemID == reportSectionLanguage.LastUpdateContactTVItemID select c).FirstOrDefault();

            if (TVItemLastUpdateContactTVItemID == null)
            {
                reportSectionLanguage.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes.CouldNotFind_With_Equal_, "TVItem", "LastUpdateContactTVItemID", reportSectionLanguage.LastUpdateContactTVItemID.ToString()), new[] { "LastUpdateContactTVItemID" }));
            }
            else
            {
                List <TVTypeEnum> AllowableTVTypes = new List <TVTypeEnum>()
                {
                    TVTypeEnum.Contact,
                };
                if (!AllowableTVTypes.Contains(TVItemLastUpdateContactTVItemID.TVType))
                {
                    reportSectionLanguage.HasErrors = true;
                    yield return(new ValidationResult(string.Format(CSSPServicesRes._IsNotOfType_, "LastUpdateContactTVItemID", "Contact"), new[] { "LastUpdateContactTVItemID" }));
                }
            }

            retStr = "";      // added to stop compiling CSSPError
            if (retStr != "") // will never be true
            {
                reportSectionLanguage.HasErrors = true;
                yield return(new ValidationResult("AAA", new[] { "AAA" }));
            }
        }
コード例 #38
0
 public INCCTestDataStyle(System.Type column, short prelines, ReportSection sec = ReportSection.Standard)
     : base(column, prelines, sec)
 {
 }