本文整理汇总了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);
}