当前位置: 首页>>代码示例>>C#>>正文


C# Report.AppendReport方法代码示例

本文整理汇总了C#中Report.AppendReport方法的典型用法代码示例。如果您正苦于以下问题:C# Report.AppendReport方法的具体用法?C# Report.AppendReport怎么用?C# Report.AppendReport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Report的用法示例。


在下文中一共展示了Report.AppendReport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Summary

        internal ReportResult Summary(PurseSeineTrip trip)
        {
            // Empty spreadsheet
            if (null == trip || null == trip.SeaDays || 0 == trip.SeaDays.Count)
                return new ReportResult(new Report());

            var activities =
                from d in trip.SeaDays
                from a in d.Activities
                select new ActivityLogLineItem
                {
                    ShipsTime = a.LocalTime.Value,
                    Latitude = a.Latitude,
                    Longitude = a.Longitude,
                    Activity = a.ActivityType.HasValue ? a.ActivityType.Value.ToString() : String.Empty,
                    WindDirection = a.WindDirection,
                    WindSpeed = a.WindSpeed,
                    SeaCode = a.SeaCode.HasValue ? a.SeaCode.Value.ToString() : String.Empty,
                    Comments = a.Comments
                };

            var sets =
                from fset in trip.FishingSets
                select new SetLogLineItem
                {
                    SetNumber = fset.SetNumber,
                    VesselLogDate = fset.Activity.LocalTime.Value,
                    SkiffOff = fset.SkiffOff,
                    WinchOn = fset.WinchOn,
                    RingsUp = fset.RingsUp,
                    BrailStart = fset.BeginBrailing,
                    BrailEnd = fset.EndBrailing,
                    EndOfSet = fset.EndOfSet,
                    SumOfBrails = Sum(fset.SumOfBrail1, fset.SumOfBrail2), // Regular addition operator doesn't work as expected
                    TotalCatch = fset.TotalCatch
                };

            // From here (see jshannon99 response of 9 November)
            // http://doddlereport.codeplex.com/discussions/283107
            var writer = new DoddleReport.OpenXml.ExcelReportWriter();
            var activityReport = new Report(activities.ToReportSource(), writer);
            var setReport = new Report(sets.ToReportSource(), writer);

            // Set up some labels
            activityReport.TextFields.Title = trip.ToString();
            activityReport.RenderHints["SheetName"] = "Activity Log";
            setReport.RenderHints["SheetName"] = "Set Log";

            // TODO:  Consider adding confidentiality footers to the report
            activityReport.AppendReport(setReport);
            return new ReportResult(activityReport, writer);
        }
开发者ID:spc-ofp,项目名称:tubs-web,代码行数:52,代码来源:ExportController.cs


注:本文中的Report.AppendReport方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。