本文整理汇总了C#中StiReport.GetComponentByName方法的典型用法代码示例。如果您正苦于以下问题:C# StiReport.GetComponentByName方法的具体用法?C# StiReport.GetComponentByName怎么用?C# StiReport.GetComponentByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StiReport
的用法示例。
在下文中一共展示了StiReport.GetComponentByName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateReport
public virtual StiReport CreateReport([NotNull] OrderReportModel model)
{
Assert.ArgumentNotNull(model, "model");
StiReport report = new StiReport();
string language = string.IsNullOrEmpty(model.LanguageCode) ? Sitecore.Context.Language.Name : model.LanguageCode;
string reportFilePath = FileUtil.MapPath(this.ReportFile);
StiConfig.ApplicationDirectory = FileUtil.GetParentPath(reportFilePath);
string reportFileName = Path.GetFileNameWithoutExtension(reportFilePath);
reportFileName = string.Concat(reportFileName, "-", language, ".dll");
string compiledReportFile = FileUtil.MakePath(StiConfig.ApplicationDirectory, reportFileName);
if (!this.reportHelper.CheckIfCompiledReportExists(compiledReportFile))
{
report.Load(reportFilePath);
report.Dictionary.Variables[UrlKey].Value = this.GetLogoUrl();
report.AutoLocalizeReportOnRun = true;
this.reportTranslator.Translate(report, language);
StiImage image = (StiImage)report.GetComponentByName(LogoImageKey);
string reportLogoFilePath = FileUtil.MapPath(this.LogoFile);
image.Image = System.Drawing.Image.FromFile(reportLogoFilePath);
this.reportHelper.CompileReport(report, compiledReportFile);
}
else
{
report = this.reportHelper.GetCompiledReport(compiledReportFile);
}
if (model.CompanyMasterData != null)
{
model.CompanyMasterData.ReadData();
}
if (model.Order != null)
{
report.RegData("Order", model);
}
return report;
}