本文整理汇总了C#中Report类的典型用法代码示例。如果您正苦于以下问题:C# Report类的具体用法?C# Report怎么用?C# Report使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Report类属于命名空间,在下文中一共展示了Report类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Index
//
// GET: /Platform/SysRole/
public ActionResult Index(int pageIndex = 1)
{
var model =
_sysRoleService.GetAll()
.Select(
a =>
new
{
a.RoleName,
a.SystemId,
Population = a.SysRoleSysUsers.Count(),
a.CreatedDate,
a.Remark,
a.Id
});
ViewBag.PropertyInfo = model.ElementType.GetProperties();
model = model.Processing(Request.QueryString);
if (!string.IsNullOrEmpty(Request["report"]))
{
//导出
var reportModel = new Report(model.ToReportSource());
return new ReportResult(reportModel);
}
return View(model.ToPagedList(pageIndex));
}
示例2: GenerateReport
public Report GenerateReport(Network net)
{
Optimization optimal = net.OptimizationResult;
Report report = new Report();
report.ReportedNetwork = net;
report.UnoptimizedReport = new UnoptimizedSection();
if(optimal != null)
{
var optimizedReport = new OptimizedSection()
{
TotalCost = optimal.TotalCost,
LinkCosts = new Dictionary<Link, LinkCost>(),
RawOptimization = optimal
};
foreach(var olink in optimal.Links)
{
var link = olink.Link;
LinkCost lcost = new LinkCost();
lcost.CarFlowCost = olink.Flow * link.Distance * net.CarCostPerMile;
lcost.LocomotiveCost = olink.CurrentTrains * link.Distance
* (net.FuelCostPerMile + net.NonFuelCostPerMile);
optimizedReport.LinkCosts.Add(link, lcost);
}
report.OptimizedReport = optimizedReport;
}
return report;
}
示例3: CompileGeneralStats
public static Report CompileGeneralStats()
{
Report report = new Report( "General Stats", "200" );
report.Columns.Add( "50%", "left" );
report.Columns.Add( "50%", "left" );
int npcs = 0, players = 0;
foreach ( Mobile mob in World.Mobiles.Values )
{
if ( mob.Player )
++players;
else
++npcs;
}
report.Items.Add( "NPCs", npcs, "N0" );
report.Items.Add( "Players", players, "N0" );
report.Items.Add( "Clients", NetState.Instances.Count, "N0" );
report.Items.Add( "Accounts", Accounts.Table.Count, "N0" );
report.Items.Add( "Items", World.Items.Count, "N0" );
return report;
}
示例4: Run
public static void Run()
{
// 帳票定義ファイルを読み込みます
Report report = new Report(Json.Read("report\\example2.rrpt"));
// GlobalScopeに値を登録します
report.GlobalScope.Add("startDate", DateTime.ParseExact("2013/02/01", "yyyy/MM/dd", null));
report.GlobalScope.Add("endDate", DateTime.ParseExact("2013/02/28", "yyyy/MM/dd", null));
report.GlobalScope.Add("printDate", DateTime.Today);
report.GlobalScope.Add("kaisha", "株式会社 システムベース");
// 帳票にデータを渡します
report.Fill(new ReportDataSource(getDataTable()));
// PDF出力の実行時間を計測します
Stopwatch sw = new Stopwatch();
sw.Start();
// ページ分割を行います
ReportPages pages = report.GetPages();
// PDF出力
using (FileStream fs = new FileStream("output\\example2_huge.pdf", FileMode.Create))
{
PdfRenderer renderer = new PdfRenderer(fs);
// バックスラッシュ文字を円マーク文字に変換します
renderer.Setting.ReplaceBackslashToYen = true;
pages.Render(renderer);
}
// 計測結果を表示します
System.Windows.Forms.MessageBox.Show("実行時間は" + sw.ElapsedMilliseconds + "ミリ秒です");
}
示例5: showReport
private void showReport(Report report)
{
txtName.Text = report.Name;
txtReportUrl.Text = report.ReportUrl;
if (report.ReportTablesSchemaId.HasValue)
cboReportTablesSchemaId.SelectedValue = report.ReportTablesSchemaId.ToString();
}
示例6: EnsureTypes
private static void EnsureTypes()
{
if (reportsByCategory != null)
return;
var reportByKeyNew = new Dictionary<string, Report>();
var reportsByCategoryNew = new Dictionary<string, List<Report>>();
foreach (var assembly in ExtensibilityHelper.SelfAssemblies)
foreach (var type in assembly.GetTypes())
{
var attr = type.GetCustomAttribute<ReportAttribute>(false);
if (attr != null)
{
var report = new Report(type);
var key = report.Key.TrimToNull() ?? type.FullName;
reportByKeyNew[key] = report;
var category = report.Category.Key;
List<Report> reports;
if (!reportsByCategoryNew.TryGetValue(category, out reports))
{
reports = new List<Report>();
reportsByCategoryNew[category] = reports;
}
reports.Add(report);
}
}
reportsByCategory = reportsByCategoryNew;
reportByKey = reportByKeyNew;
}
示例7: ReportTableRow
public ReportTableRow(Village village, Report report)
{
_report = report;
if (village == report.Defender.Village)
{
_village = report.Defender.Village;
_villageOther = report.Attacker.Village;
}
else
{
_village = report.Attacker.Village;
_villageOther = report.Defender.Village;
}
Cells.Add(new Cell(string.Empty, Report.GetCircleImage(report)));
Cells.Add(new Cell(string.Empty, Report.GetInfoImage(report)));
Cells.Add(new Cell(_village.LocationString));
if (_village.HasPlayer)
{
Cells.Add(new Cell(_village.Player.Name));
}
else
{
Cells.Add(new Cell());
}
Cells.Add(new Cell(report.Date));
}
示例8: ReportData
public static void ReportData()
{
int totalProducts = 0;
int totalOrders = 0;
// Get the data for the report (any IEnumerable or LINQ query will work)
var query = ProductRepository.GetAll();
// Create the report and turn our query into a ReportSource
var report = new Report(query.ToReportSource());
// Customize the Text Fields
report.TextFields.Title = "Products Report";
report.TextFields.SubTitle = "This is a sample report showing how Doddle Report works";
report.TextFields.Footer = "Copyright 2011 © The Doddle Project";
report.TextFields.Header = string.Format(@"
Report Generated: {0}
Total Products: {1}
Total Orders: {2}
Total Sales: {3:c}", DateTime.Now, totalProducts, totalOrders, totalProducts * totalOrders);
// Render hints allow you to pass additional hints to the reports as they are being rendered
report.RenderHints.BooleanCheckboxes = true;
// Customize the data fields
report.DataFields["Id"].Hidden = true;
report.DataFields["Price"].DataFormatString = "{0:c}";
report.DataFields["LastPurchase"].DataFormatString = "{0:d}";
// Write now!
var writer = new HtmlReportWriter();
writer.WriteReport(report, HttpContext.Response.OutputStream);
}
示例9: Main
static int Main (string [] args)
{
var r = new Report (new ConsoleReportPrinter ());
var cmd = new CommandLineParser (r);
cmd.UnknownOptionHandler += HandleExtraArguments;
var settings = cmd.ParseArguments (args);
if (settings == null || r.Errors > 0)
return 1;
var startup_files = new string [settings.SourceFiles.Count];
int i = 0;
foreach (var source in settings.SourceFiles)
startup_files [i++] = source.FullPathName;
settings.SourceFiles.Clear ();
var eval = new Evaluator (settings, r);
eval.InteractiveBaseClass = typeof (InteractiveBaseShell);
eval.DescribeTypeExpressions = true;
CSharpShell shell;
#if !ON_DOTNET
if (attach.HasValue) {
shell = new ClientCSharpShell (eval, attach.Value);
} else if (agent != null) {
new CSharpAgent (eval, agent).Run (startup_files);
return 0;
} else
#endif
{
shell = new CSharpShell (eval);
}
return shell.Run (startup_files);
}
示例10: PrintTemplateSetting
public PrintTemplateSetting()
{
InitializeComponent();
Report report = new Report();
//report.Design();
reportDesiger.Report = report;
}
示例11: tokenizerTest
private static void tokenizerTest()
{
var list = new List<TokenInfo>();
var report = new Report();
var tokenizer = new Tokenizer("Tests/helloworld.vb", report);
TokenInfo token;
while (!tokenizer.IsEOF)
{
token = tokenizer.GetNextToken();
list.Add(token);
Console.WriteLine("{0,-20} {1, -30} {2}, {3}", token.GetString(), token.Token, token.Ln, token.Col);
}
token = tokenizer.PeekToken();
list.Add(token);
Console.WriteLine(token);
printErrors(report);
}
示例12: ReportPrinter
/// <summary>
/// Initializes an instance of the ReportPrinter class.
/// </summary>
/// <param name="writer">The TextWriter to write to.</param>
/// <param name="report">The Report to print.</param>
public ReportPrinter(TextWriter writer, Report report)
{
Writer = writer;
Report = report;
Console.SetOut(writer);
}
示例13: Insert
/// <summary>
/// Inserts (creates) a simple standard report for a given advertiser.
/// </summary>
/// <param name="userProfileId">The ID number of the DFA user profile to run this request as.</param>
/// <param name="advertiser">The advertiser who the report is about.</param>
/// <param name="startDate">The starting date of the report.</param>
/// <param name="endDate">The ending date of the report.</param>
/// <returns>The newly created report</returns>
public Report Insert(long userProfileId, DimensionValue advertiser, DateTime startDate, DateTime endDate)
{
Console.WriteLine("=================================================================");
Console.WriteLine("Creating a new standard report for advertiser {0}%n", advertiser.Value);
Console.WriteLine("=================================================================");
// Create a report.
var report = new Report();
report.Name = string.Format("API Report: Advertiser {0}", advertiser.Value);
report.FileName = "api_report_files";
// Set the type of report you want to create. Available report types can be found in the description of
// the type property: https://developers.google.com/doubleclick-advertisers/reporting/v1.1/reports
report.Type = "FLOODLIGHT";
report.Type = "STANDARD";
// Create criteria.
var criteria = new Report.CriteriaData();
criteria.DateRange = new DateRange
{
StartDate = DfaReportingDateConverterUtil.convert(startDate),
EndDate = DfaReportingDateConverterUtil.convert(endDate)
};
// Set the dimensions, metrics, and filters you want in the report. The available values can be found
// here: https://developers.google.com/doubleclick-advertisers/reporting/v1.1/dimensions
criteria.Dimensions = new List<SortedDimension> { new SortedDimension { Name = "dfa:advertiser" } };
criteria.MetricNames = new List<string> { "dfa:clicks", "dfa:impressions" };
criteria.DimensionFilters = new List<DimensionValue> { advertiser };
report.Criteria = criteria;
Report result = service.Reports.Insert(report, userProfileId).Execute();
Console.WriteLine("Created report with ID \"{0}\" and display name \"{1}\"", result.Id, result.Name);
Console.WriteLine();
return result;
}
示例14: Index
//
// GET: /Platform/SysUserLog/
public ActionResult Index(string keyword, string ordering, int pageIndex = 1)
{
var model =
_sysUserLogService.GetAll()
.Select(
a =>
new
{
a.SysUser.UserName,
a.SysUser.DisplayName,
a.SysControllerSysAction.SysController.SysArea.AreaDisplayName,
a.SysControllerSysAction.SysController.ControllerDisplayName,
a.SysControllerSysAction.SysAction.ActionDisplayName,
a.RecordId,
IP = a.Ip,
a.CreatedDate
}).Search(keyword);
if (!string.IsNullOrEmpty(ordering))
{
model = model.OrderBy(ordering, null);
}
if (!string.IsNullOrEmpty(Request["report"]))
{
//导出
var reportModel = new Report(model.ToReportSource());
return new ReportResult(reportModel);
}
return View(model.ToPagedList(pageIndex));
}
示例15: CreateReport
/// <summary>
/// Creates the report.
/// </summary>
/// <returns>
/// A Report.
/// </returns>
public Report CreateReport()
{
var report = new Report ();
_reportRepository.MakePersistent ( report );
return report;
}